From 89e3219e06adb7266d15a6824a0d9b781cc27446 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 9 Jun 2018 01:38:57 +0530 Subject: [PATCH] Further fixes wrt FLAG_NOT_FOCUSABLE. --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 6eb339ffe..3aa8d68f3 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -664,7 +664,8 @@ public final class PopupVideoPlayer extends Service { hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); - windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @@ -681,7 +682,7 @@ public final class PopupVideoPlayer extends Service { videoPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_white); lockManager.releaseWifiAndCpu(); - windowLayoutParams.flags = 0; + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @@ -698,6 +699,9 @@ public final class PopupVideoPlayer extends Service { updateNotification(R.drawable.ic_replay_white); videoPlayPause.setBackgroundResource(R.drawable.ic_replay_white); lockManager.releaseWifiAndCpu(); + + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @Override