Android Management API - Single App in Kiosk Mode - How to hide status and navigation bar?
Asked Answered
A

1

6

What I would like to achieve?

For internal purposes only / within our enterprise only, I would like to have Android tablets, which run only one single app (made with Ionic/Angular) which even appears after restarting the tablet and the user is not able to leave it.

I think the technical description of what I would like to achieve is called a dedicated devices (formerly called corporate-owned single-use, or COSU).

How would I like to achieve it?

I would like to achieve this with Android Management API, which looks like a great choice for a MDM (Mobile Device Management) solution.

Here Google shows how to achieve this with an Android Management API policy.

The Problem?

I am not able to get rid of the status and navigation bar.

For testing purposes I tried to achieve this with the regular YouTube app. With "statusBarDisabled": true, I was able to disable the status bar, so the user can not interact with it, but it is still visible.

And same goes for the navigation bar with

"persistentPreferredActivities":[  
   {  
      "receiverActivity":"com.google.android.youtube",
      "actions":[  
         "android.intent.action.MAIN"
      ],
      "categories":[  
         "android.intent.category.HOME",
         "android.intent.category.DEFAULT"
      ]
   }
]

I was able to hide the home and recents buttons, but the back button is still there and the whole navigation bar is visible.


The following image visualises the problem:

Shows the YouTube app in kiosk mode, status bar and navigation bar are visible.

Anyone an idea how I can get rid of the status and navigation bar completely?


This is how my whole policy looks like:

import json

policy_name = enterprise_name + '/policies/policy1'

policy_json = '''
{
"safeBootDisabled": true,
"statusBarDisabled": true,
"keyguardDisabled": true,
"screenCaptureDisabled": true,
"factoryResetDisabled": true,
"cameraDisabled": true,
"blockApplicationsEnabled": true,
"systemUpdate": {
"type": "WINDOWED",
"startMinutes": 120,
"endMinutes": 240
},

"policyEnforcementRules": [{
"settingName": "persistentPreferredActivities",
"blockAction": {
"blockAfterDays": 0
},
"wipeAction": {
"wipeAfterDays": 3,
"preserveFrp": true
}
}],

"applications": [
{
"packageName": "com.google.android.youtube",
"installType": "FORCE_INSTALLED",
"lockTaskAllowed": true,
"defaultPermissionPolicy": "GRANT"
}
],
"persistentPreferredActivities": [
{
"receiverActivity": "com.google.android.youtube",
"actions": [
"android.intent.action.MAIN"
],
"categories": [
"android.intent.category.HOME",
"android.intent.category.DEFAULT"
]
}
]
}
'''

androidmanagement.enterprises().policies().patch(
name=policy_name,
body=json.loads(policy_json)
).execute()

Abana answered 28/6, 2019 at 19:17 Comment(4)
I guess not that many people using Android Management API. . .Abana
Did you find a solution for that? I'm having the same problem with the new installType KIOSK configuration.Eidetic
Same here. And the weird thing for me is that, it actually was working for me last week but it suddenly stopped working when I tried to re-provision the device today with the same policy and app. And with kioskCustomLauncherEnabled, I am able to hide those navigation buttons (but I would prefer KIOSK installType if possible)Boak
@H.T.Koo How are you able to hide these buttons?Buster
S
-1

The two bars you've highlight are actually part of the youtube app NOT part of the android OS/UI. So you can't hide those using the device management API.

Seagraves answered 10/7, 2019 at 5:10 Comment(1)
Hey @flint, thanks for your answer. But they are definitely not part of YouTube. The YouTube app itself e.g. has no bar at the bottom with just a back button nor and empty grey bar at the top. But we just handled it within the app instead with the API.Abana

© 2022 - 2024 — McMap. All rights reserved.