I'm developing a simple Kiosk Mode application for Android 6.0. I have everything working on devices from Xiaomi, HTC, Lenovo, etc. but I can't get one feature working on any Samsung device.
The feature is automatic closing of every system system dialog using
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
This is broadcasted from a Service.
On my other, non-samsung devices, everything works and all system dialogs closes, but on any Samsung device (S5, S6 edge, ...) this broadcast gets ignored and for example the app drawer stays opened.
I've observed that even using ADB to broadcast this intent, app drawer stays opened, but for example the shutdown device dialog gets closed if I broadcast this from adb.
Please note that this is not malicious action in context of this software, this is for client, that requires this feature and it is completely solicited.
I've done research on Samsung Knox, but we would have to obtain their license for using the Knox Standard SDK and that is not something that is in the scope of this project.
So my question is: Do you have any idea how to make this work (closing the app drawer with ACTION_CLOSE_SYSTEM_DIALOGS intent) on samsung devices with Knox installed?
Thanks.
In the following cases, an app can still close system dialogs on Android 12 or higher: Your app is running an instrumentation test. Your app targets Android 11 or lower and is showing a window that is on top of the notification drawer. Note: If your app targets Android 12, you don't need to use ACTION_CLOSE_SYSTEM_DIALOGS in this situation.
Only way to do so is to close all open apps by clicking on "Close All" button. Samsung, please either return to titled open apps in which each one cn be closed seperately or fix the bug with no being able to close individual apps now. 02-21-2019 12:19 PM in
Note: If your app targets Android 12, you don't need to use ACTION_CLOSE_SYSTEM_DIALOGS in this situation. That's because, if your app calls startActivity () while a window is on top of the notification drawer, the system closes the notification drawer automatically. Your app targets Android 11 or lower.
Samsung is aware of this issue that can occur on Galaxy devices due to the Google Webview issue and this issue has already been resolved with the latest Android System Webview and Chrome app updates, version 89.0.4389.105. So please update these apps to the latest version by following the steps and restart the device.
Try doing it like this :
@Override
public void onWindowFocusChanged(boolean focus) {
super.onWindowFocusChanged(focus);
if (! focus) {
Intent close= new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(close);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With