File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
app/src/main/java/dev/pranav/applock/features/lockscreen/ui Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -136,19 +136,28 @@ class PasswordOverlayActivity : FragmentActivity() {
136136 }
137137 }
138138
139+
139140 private fun setupWindow () {
140141 window.addFlags(
141142 WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON or
142- WindowManager .LayoutParams .FLAG_TURN_SCREEN_ON or
143- WindowManager .LayoutParams .FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
143+ WindowManager .LayoutParams .FLAG_TURN_SCREEN_ON or
144+ WindowManager .LayoutParams .FLAG_ALLOW_LOCK_WHILE_SCREEN_ON or
145+ WindowManager .LayoutParams .FLAG_SECURE
144146 )
147+
145148 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O_MR1 ) {
146149 setShowWhenLocked(true )
147150 setTurnScreenOn(true )
148151 }
152+
153+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S ) {
154+ window.setHideOverlayWindows(true )
155+ }
156+
149157
150158 val layoutParams = window.attributes
151- layoutParams.type = WindowManager .LayoutParams .TYPE_APPLICATION_OVERLAY
159+ layoutParams.type = WindowManager .LayoutParams .TYPE_APPLICATION_OVERLAY
160+
152161 if (appLockRepository.shouldUseMaxBrightness()) {
153162 layoutParams.screenBrightness = WindowManager .LayoutParams .BRIGHTNESS_OVERRIDE_FULL
154163 }
You can’t perform that action at this time.
0 commit comments