Skip to content Skip to sidebar Skip to footer

Android Things Doesn't Grant Permissions On Boot, What Gives?

Got this shiny manifest ready to be granted all ze permissions

Solution 1:

With Developer Preview 6, you should use the DeviceManager API. Reboot permission can only be granted to system apps if I'm not wrong, and the Android Things console will never package your APK as a system app.

new DeviceManager().reboot()

Solution 2:

To summerize things... Altough it's stated in Android Things readme that:

All normal and dangerous permissions declared in your app's manifest are granted at install time.

It's not enough to declare permissions in manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.yyy">

    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="com.google.android.things.permission.MODIFY_SCREEN_SETTINGS"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

    <application>
    </application>
</manifest>

You need to restart the device with the installed application.

APPLICATION RIGHTS ARE GRANTED UPON DEVICE RESTART not application restart.


Post a Comment for "Android Things Doesn't Grant Permissions On Boot, What Gives?"