Currently I found out that our app crashes when tries to requestListeningState of TileService on Android 13 (both compile and targetSdk 33) while running in workProfile.
Caused by: java.lang.IllegalArgumentException: User 10 is not the current user.
Does anybody have similar issue, or any idea why it happens or how to fix that?
Since Android 13, requestListeningState throw IllegalArgumentException if the user of the context is not the current user. See https://developer.android.com/reference/android/service/quicksettings/TileService#requestListeningState(android.content.Context,%20android.content.ComponentName)
On Android, the work profile is considered like another user. Apps on work profile cannot interact with tiles from main profile anyway. The tile on Android 12 and below only interact with the app on main profile, and not with the app on work profile.
Currently, I don't think there is a way to support tiles on a work profile for an app.