diff options
| author | Makoto Onuki <omakoto@google.com> | 2021-11-17 18:11:17 +0000 |
|---|---|---|
| committer | Makoto Onuki <omakoto@google.com> | 2021-11-17 18:18:24 +0000 |
| commit | 543acbc321d699ccbc0cd2baa0447dd4a309f118 (patch) | |
| tree | 04aeb87af4710c57121c543cdd2571ce596fc5d0 /core/java/android/app/ActivityThread.java | |
| parent | 68d184985b4101c65f2583dd8bc5505abe92b61c (diff) | |
| parent | abdd86b297820b88ef9f0402e31a93f18b7c5956 (diff) | |
Merge "Use different exceptions for different crash reasons" into sc-v2-dev am: 5dcf36ad8d am: abdd86b297
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16276394
Change-Id: I0b67b009bf110b56fdb86778213092f15e758fab
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index ffa7cf18819e..c89e8b0f8d32 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -41,6 +41,12 @@ import android.annotation.ElapsedRealtimeLong; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UptimeMillisLong; +import android.app.RemoteServiceException.BadForegroundServiceNotificationException; +import android.app.RemoteServiceException.CannotDeliverBroadcastException; +import android.app.RemoteServiceException.CannotPostForegroundServiceNotificationException; +import android.app.RemoteServiceException.CrashedByAdbException; +import android.app.RemoteServiceException.ForegroundServiceDidNotStartInTimeException; +import android.app.RemoteServiceException.MissingRequestPasswordComplexityPermissionException; import android.app.assist.AssistContent; import android.app.assist.AssistStructure; import android.app.backup.BackupAgent; @@ -1929,11 +1935,27 @@ public final class ActivityThread extends ClientTransactionHandler private void throwRemoteServiceException(String message, int typeId) { // Use a switch to ensure all the type IDs are unique. switch (typeId) { - case ForegroundServiceDidNotStartInTimeException.TYPE_ID: // 1 + case ForegroundServiceDidNotStartInTimeException.TYPE_ID: throw new ForegroundServiceDidNotStartInTimeException(message); - case RemoteServiceException.TYPE_ID: // 0 + + case CannotDeliverBroadcastException.TYPE_ID: + throw new CannotDeliverBroadcastException(message); + + case CannotPostForegroundServiceNotificationException.TYPE_ID: + throw new CannotPostForegroundServiceNotificationException(message); + + case BadForegroundServiceNotificationException.TYPE_ID: + throw new BadForegroundServiceNotificationException(message); + + case MissingRequestPasswordComplexityPermissionException.TYPE_ID: + throw new MissingRequestPasswordComplexityPermissionException(message); + + case CrashedByAdbException.TYPE_ID: + throw new CrashedByAdbException(message); + default: - throw new RemoteServiceException(message); + throw new RemoteServiceException(message + + " (with unwknown typeId:" + typeId + ")"); } } |
