From cb507b828a982a460077c44f018492f87aebdcdf Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 7 Sep 2017 13:53:40 -0400 Subject: [PATCH] Don't crash system server Change-Id: I6422017bf85f9751fe9bab3136e357b55e17c429 Fixes: 65374410 Test: make --- .../java/com/android/server/notification/ManagedServices.java | 2 +- .../java/com/android/server/notification/ZenModeHelper.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java index 34f1bfaf996f5..91ecb3aad26e8 100644 --- a/services/core/java/com/android/server/notification/ManagedServices.java +++ b/services/core/java/com/android/server/notification/ManagedServices.java @@ -494,7 +494,7 @@ abstract public class ManagedServices { return info; } throw new SecurityException("Disallowed call from unknown " + getCaption() + ": " - + service); + + service + " " + service.getClass()); } public void unregisterService(IInterface service, int userid) { diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java index 3194c520b8107..ffdafc5626735 100644 --- a/services/core/java/com/android/server/notification/ZenModeHelper.java +++ b/services/core/java/com/android/server/notification/ZenModeHelper.java @@ -737,6 +737,9 @@ public class ZenModeHelper { mConfig = config; mHandler.postApplyConfig(config, reason, setRingerMode); return true; + } catch (SecurityException e) { + Log.wtf(TAG, "Invalid rule in config", e); + return false; } finally { Binder.restoreCallingIdentity(identity); }