From fc3ec92a971cff343bcf10c069bcc6a3b4cad78c Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Thu, 20 Jan 2022 08:58:08 -0800 Subject: [PATCH] *ServiceStartNotAllowedException shouldn't have a "cause" Bug: 210890426 Test: build Change-Id: I94ba39c775cf95074907db6814104289a577d496 --- core/java/android/app/ServiceStartNotAllowedException.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/java/android/app/ServiceStartNotAllowedException.java b/core/java/android/app/ServiceStartNotAllowedException.java index 33285b2190eb5..b1f47eee4bfd7 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; + } }