Skip to content

Commit

Permalink
[keep-awake] Fix mixing tags breaks keepAwake functionality (#7197)
Browse files Browse the repository at this point in the history
* [keep-awake] Fix mixing tags breaks keepAwake functionality

* [keep-awake] Update changelog
  • Loading branch information
lukmccall committed Mar 9, 2020
1 parent 179e068 commit 0a3bd63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 0a3bd63

Please sign in to comment.