From a055f13ce969c1a499c95873dab037b3b0db95ce Mon Sep 17 00:00:00 2001 From: Hyundo Moon Date: Fri, 13 Jan 2017 15:31:06 +0900 Subject: [PATCH] Fix NullPointerException in System UI caused by remote volume change VolumeDialogController(System UI) only manages active sessions, but MediaSessionService always notifies the System UI of remote volume change regardless of whether the session is active or not. This CL makes MediaSessionService notify of remote volume change only when the session is active. Bug: 34033926 Test: Flashed new master build on angler and tested. Change-Id: Id363c078f75d49732aa7af9578ee44a24649df63 --- .../java/com/android/server/media/MediaSessionService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java index 9b37f12e468a8..2ac5fafa6f6bd 100644 --- a/services/core/java/com/android/server/media/MediaSessionService.java +++ b/services/core/java/com/android/server/media/MediaSessionService.java @@ -150,10 +150,10 @@ public class MediaSessionService extends SystemService implements Monitor { } /** - * Tells the system UI that volume has changed on a remote session. + * Tells the system UI that volume has changed on an active remote session. */ public void notifyRemoteVolumeChanged(int flags, MediaSessionRecord session) { - if (mRvc == null) { + if (mRvc == null || !session.isActive()) { return; } try {