Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keep-awake] Fix mixing tags breaks keepAwake functionality #7197

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ This is the log of notable changes to the Expo client that are developer-facing.
### 🐛 Bug fixes

- Fixed `Brightness.requestPermissionsAsync` throwing `permission cannot be null or empty` error on Android. ([#7276](https://github.com/expo/expo/pull/7276) by [@lukmccall](https://github.com/lukmccall))
- Fixed `KeepAwake.activateKeepAwake` not working with multiple tags on Android. ([#7197](https://github.com/expo/expo/pull/7197) by [@lukmccall](https://github.com/lukmccall))

## 37.0.0

Expand Down
Expand Up @@ -49,7 +49,8 @@ public void activate(final String tag, final Runnable done) throws CurrentActivi
@Override
public void deactivate(final String tag, final Runnable done) throws CurrentActivityNotFoundException {
final Activity activity = getCurrentActivity();
if (isActivated() && activity != null) {

if (mTags.size() == 1 && mTags.contains(tag) && activity != null) {
activity.runOnUiThread(() -> activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON));
}
mTags.remove(tag);
Expand Down