diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt b/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt index 093d098de3e3..d9a8080a1e83 100644 --- a/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt +++ b/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt @@ -325,7 +325,13 @@ constructor( } else { // TODO(b/278729185): Replace fire and forget service with a bounded service. val intent = NoteTaskControllerUpdateService.createIntent(context) - context.startServiceAsUser(intent, user) + try { + // If the user is stopped before 'startServiceAsUser' kicks-in, a + // 'SecurityException' will be thrown. + context.startServiceAsUser(intent, user) + } catch (e: SecurityException) { + debugLog(error = e) { "Unable to start 'NoteTaskControllerUpdateService'." } + } } } |