Skip to content

Commit

Permalink
fix: crash in work profile due to TileService
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyi1 committed Jan 31, 2024
1 parent 51b02c8 commit 836a867
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Android/app/src/main/java/app/intra/sys/IntraVpnService.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,14 @@ private void stopVpnAdapter() {

private void updateQuickSettingsTile() {
if (VERSION.SDK_INT >= VERSION_CODES.N) {
TileService.requestListeningState(this,
new ComponentName(this, IntraTileService.class));
try {
TileService.requestListeningState(this,
new ComponentName(this, IntraTileService.class));
} catch (SecurityException ignored) {
} catch (IllegalArgumentException ignored) {
// Starting from API level 33, TileService will throw exceptions from apps in Work Profile
// See: https://developer.android.com/reference/android/service/quicksettings/TileService
}
}
}

Expand Down

0 comments on commit 836a867

Please sign in to comment.