summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2022-01-20 08:58:08 -0800
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-01-23 20:56:24 +0000
commit34af3074f2e0bb1b42fcdd39e295411dba514be2 (patch)
tree263606a08c688cd31d68d48dfff7c947466e573d
parent17df79ccc0ce4e5001b4f68c71a174d1b178f7b8 (diff)
downloadbase-34af3074f2e0bb1b42fcdd39e295411dba514be2.tar.gz
*ServiceStartNotAllowedException shouldn't have a "cause"
Bug: 210890426 Test: Manual test with a test app, received this exception and made sure cause isn't set. Change-Id: I94ba39c775cf95074907db6814104289a577d496 Merged-in: I94ba39c775cf95074907db6814104289a577d496 (cherry picked from commit d4396b9a9d699b2b7c8029d024af912198207f68) Merged-In:I94ba39c775cf95074907db6814104289a577d496
-rw-r--r--core/java/android/app/ServiceStartNotAllowedException.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/app/ServiceStartNotAllowedException.java b/core/java/android/app/ServiceStartNotAllowedException.java
index 33285b2190eb..b1f47eee4bfd 100644
--- a/core/java/android/app/ServiceStartNotAllowedException.java
+++ b/core/java/android/app/ServiceStartNotAllowedException.java
@@ -40,4 +40,11 @@ public abstract class ServiceStartNotAllowedException extends IllegalStateExcept
return new BackgroundServiceStartNotAllowedException(message);
}
}
+
+ @Override
+ public synchronized Throwable getCause() {
+ // "Cause" is often used for clustering exceptions, and developers don't want to have it
+ // for this exception. b/210890426
+ return null;
+ }
}