Catch quick settings tile exceptions (#7006)

The exception gets thrown if AntennaPod is installed in a work profile.
This commit is contained in:
ByteHamster 2024-03-20 20:30:45 +01:00 committed by GitHub
parent 8177875674
commit ac8e8137bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -44,7 +44,7 @@ android {
}
lint {
disable "GradleDependency"
disable "GradleDependency", "OutdatedLibrary"
checkDependencies true
warningsAsErrors true
abortOnError true

View File

@ -867,8 +867,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
TileService.requestListeningState(getApplicationContext(),
new ComponentName(getApplicationContext(), QuickSettingsTileService.class));
try {
TileService.requestListeningState(getApplicationContext(),
new ComponentName(getApplicationContext(), QuickSettingsTileService.class));
} catch (IllegalArgumentException e) {
Log.d(TAG, "Skipping quick settings tile setup");
}
}
IntentUtils.sendLocalBroadcast(getApplicationContext(), ACTION_PLAYER_STATUS_CHANGED);