From 4a05bbcd38604cbbcbac66af1abc69ecffddad8b Mon Sep 17 00:00:00 2001 From: Sungmin Choi Date: Fri, 7 Aug 2015 18:12:19 -0700 Subject: [PATCH] Fix to check the incoming userid argument for RingtonePlayer In PowerNotificationWarnings, where it dispatches notifications with UserHandle.ALL: mNoMan.notifyAsUser(TAG_NOTIFICATION, R.id.notification_power, n, UserHandle.ALL); The fix is to have RingtonePlayer check the incoming userId argument to playAsync(), and change USER_ALL to USER_OWNER. BUG=22516181 BUG=22992637 Change-Id: Ia3f8aaa2bee7fb15c24542e2331b2bc5a877e715 --- .../src/com/android/systemui/media/RingtonePlayer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java b/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java index fe876d7a4d30d..7f68e290f3a0b 100644 --- a/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java +++ b/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java @@ -159,7 +159,9 @@ public class RingtonePlayer extends SystemUI { if (Binder.getCallingUid() != Process.SYSTEM_UID) { throw new SecurityException("Async playback only available from system UID."); } - + if (UserHandle.ALL.equals(user)) { + user = UserHandle.OWNER; + } mAsyncPlayer.play(getContextForUser(user), uri, looping, aa); }