Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Samsung devices does not close app drawer after CLOSE_SYSTEM_DIALOGS broadcast

Tags:

android

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.

like image 693
Lukáš Benke Avatar asked Mar 31 '17 08:03

Lukáš Benke


People also ask

Why can't I close system dialogs on Android 12 or higher?

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.

How to close all open apps at once on Samsung Galaxy?

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

Do I need to use action_close_system_dialogs?

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.

What to do if Google WebView is not working on Samsung Galaxy?

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.


1 Answers

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);
        }
    }
like image 71
Haris ali Avatar answered Oct 18 '22 23:10

Haris ali