How to request permission on Android Things?

让人想犯罪 __ 提交于 2019-12-05 07:53:16

Like you said, the documents say:

Declare permissions that you need in your app's manifest file. All normal and dangerous permissions declared in your app's manifest are granted at install time.

Therefore you don't see the normal Android permissions UI.

From the release notes:

Dangerous permissions requested by apps are not granted until the next device reboot. This includes new app installs and new elements in existing apps.

So try powering off and on your Android Things device

After install application with the statement on AndroidManifest.xml as follow

<uses-permission android:name="android.permission.WRITE_SETTINGS"/>

It needs to be also run Settings as follow via adb

adb shell am start -S com.android.settings/.Settings

Then click APPS>YOUR_APP, then click permission.

Now the switch is clickable. So AT not granted to permission. It needs to be granted manually.

This permission is having Protection level: signature.Which means this permission is only granted to system apps.

Please find the below screenshot for your reference :

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!