Skip to content

Commit

Permalink
[keep-awake] Fix mixing tags breaks keepAwake functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmccall committed Feb 26, 2020
1 parent be68098 commit 0ab5045
Showing 1 changed file with 2 additions and 1 deletion.
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 0ab5045

Please sign in to comment.