Jil*_*Reg 6 fullscreen statusbar navigationbar kiosk-mode android-management-api
仅出于内部目的/仅在我们的企业内部,我想要一台 Android 平板电脑,它只运行一个应用程序(用 Ionic/Angular 制作),甚至在重新启动平板电脑后也会出现该应用程序,并且用户无法离开它。
我认为我想要实现的技术描述称为专用设备(以前称为企业拥有的一次性设备,或 COSU)。
我想通过Android Management API来实现这一点,这看起来是 MDM(移动设备管理)解决方案的绝佳选择。
Google在此展示了如何通过 Android 管理 API 策略来实现这一目标。
我无法摆脱状态栏和导航栏。
出于测试目的,我尝试使用常规 YouTube 应用来实现此目的。我"statusBarDisabled": true,能够禁用状态栏,因此用户无法与其交互,但它仍然可见。
导航栏也是如此
"persistentPreferredActivities":[
{
"receiverActivity":"com.google.android.youtube",
"actions":[
"android.intent.action.MAIN"
],
"categories":[
"android.intent.category.HOME",
"android.intent.category.DEFAULT"
]
}
]
Run Code Online (Sandbox Code Playgroud)
我能够隐藏主页和最近使用的按钮,但后退按钮仍然存在,并且整个导航栏可见。
下图直观地展示了该问题:
有人知道如何完全摆脱状态栏和导航栏吗?
这就是我的整个政策的样子:
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()
Run Code Online (Sandbox Code Playgroud)