- Sep 3, 2007
- 10,956
- 10,363
Samsung has done it again with the proprietary meta-data and added their own requirements on using apps on the cover screen, not unlike their silly tags for VR and multi-window.
Do you use an app that wouldn't cause any privacy concerns on the cover screen? Notify the developers.
Any app that wants to run on the cover screen can add the following tag to the AndroidManifest to enable cover screen support for a designated activity
They will also need to implement some minor detection of the current display. This is done to remain exclusively compatible with the cover widget and avoid displaying their activity above the standard lock screen.
Display over the lock screen does not require "android.permission.DISABLE_KEYGUARD" because the lock screen remains enabled.
stackoverflow.com
The actual code required to secure the phone would be the inverse of what is posted above, as the desired result is "normal" functionality.
Please feel free to direct any developers that want to add support and need help implementing it to this thread. I would be more than happy to help them get it up and running in an effort to expand support for cover screen compatibility.
Samsung has also limited the apps that can appear as cover screen widgets, but it will be even harder to impose these limits with more and more apps supporting cover screen functionality. Let's get Samsung to make the cover screen a feature and not a cheap novelty.
Do you use an app that wouldn't cause any privacy concerns on the cover screen? Notify the developers.
Any app that wants to run on the cover screen can add the following tag to the AndroidManifest to enable cover screen support for a designated activity
Code:
<meta-data android:name="com.samsung.android.activity.showWhenLocked" android:value="true"/>
They will also need to implement some minor detection of the current display. This is done to remain exclusively compatible with the cover widget and avoid displaying their activity above the standard lock screen.
Code:
mDisplayListener = object : DisplayListener {
override fun onDisplayAdded(display: Int) {}
override fun onDisplayChanged(display: Int) {
if (display == 0)
// Disable display above the lock screen
else
// Enable display above the lock screen
// Technically irrelevant for this scenario
}
}
override fun onDisplayRemoved(display: Int) {}
}
val manager = context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
manager.registerDisplayListener(mDisplayListener, Handler(Looper.getMainLooper()))
Display over the lock screen does not require "android.permission.DISABLE_KEYGUARD" because the lock screen remains enabled.
Code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
setShowWhenLocked(true)
setTurnScreenOn(true)
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
keyguardManager.requestDismissKeyguard(this, null)
} else {
this.window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
}

Android O - FLAG_SHOW_WHEN_LOCKED is deprecated
I'm targetting my application to Android O. In my application I have a job service that shows a window over all other applications, so when it triggered it needs to show this window even when the s...
The actual code required to secure the phone would be the inverse of what is posted above, as the desired result is "normal" functionality.
Please feel free to direct any developers that want to add support and need help implementing it to this thread. I would be more than happy to help them get it up and running in an effort to expand support for cover screen compatibility.
Samsung has also limited the apps that can appear as cover screen widgets, but it will be even harder to impose these limits with more and more apps supporting cover screen functionality. Let's get Samsung to make the cover screen a feature and not a cheap novelty.
Last edited: