In my application we have a Tile in the QuickSettings of Android. It is a toggleable Tile.
It was working fine in SDK 30, until I updated the SDK to 31. I read the documentation and the changes in Android 12, but I could not find anything wrong in my code. I guess it is some manifest attribute, but I could not find the solution.
The behaviour is that if I target SDK 31, the Tile is unclickable and is "Unavailable".
The related part of the manifest is like the following:
<service
android:name="<mypackagename>.QuickSettingsTileService"
android:exported="false"
android:label="@string/app_name"
android:icon="@drawable/<myapp>icon_on"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
<meta-data android:name="android.service.quicksettings.ACTIVE_TILE" android:value="true" />
</service>
So, I found the solution. The
exported
attribute must be set totrue
, that is:in the manifest.
Actually, from the documentation here, quoting:
I would not guessed that, because I though the Tile was managed by some privileged system component.
Please leave comments if you have more information about "why" I needed to
export
the service.