'How to disable MDM kiosk mode programmatically

I am facing an issue with Android Management API policy install type: KIOSK.

I have fully enrolled the device and fully working kiosk mode without a way to leave it, but unfortunately one of the libs (iZettle) required bluetooth connection but KIOSK modes hides the dialog immediately without leaving an option to connect a bluetooth device. Is there are way to disable KIOSK mode for a moment from the app in order to setup all the required equipment and turn it on again?

Kind regards



Solution 1:[1]

In kiosk mode, all packages except explicitly enabled ones are silently blocked by the OS. So, to make your app working as required without turning off kiosk mode, you need to find a blocked package and add it to the list of enabled apps.

You can achieve this by collecting logcat from the device.

  1. Install Android Studio.

  2. Turn on the developer mode on the device.

  3. Start collecting logcat.

  4. Raise the issue (try to open Bluetooth in kiosk mode).

  5. Search for messages like this:

    10-12 09:56:10.149  1408 12311 E ActivityTaskManager: Attempted Lock Task Mode violation mStartActivity=ActivityRecord{db0c8b6 u0 com.android.server.telecom/.PrivilegedCallActivity t160}
    

This message means that you need to add the com.android.server.telecom package to the kiosk mode policy (in your case, the package id may be different!).

Solution 2:[2]

try to remove wrong data and content type from you ajax

  $.ajax({
                type: "GET",
                url: "/Home/About",
                success: function (data) {
                $('#content').append(data); //or try $('#content').html(data);
                },
                error: function (ex) {
                    console.log(ex);
                }
            });

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vmayorow
Solution 2 Serge