diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2015-05-11 22:57:02 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-11 22:57:03 +0000 |
commit | cbcbb828e8e3d1f901be00c896d816d01c17b19d (patch) | |
tree | fb377c63c5a3f01da5fa66ebf5ea1f5c1652d38d /services | |
parent | a4492b418d23e3bcdb077aab5d48eb24e932fc13 (diff) | |
parent | e492d43512fd7c56e9c63d1701238d2595d58d8c (diff) | |
download | frameworks_base-cbcbb828e8e3d1f901be00c896d816d01c17b19d.zip frameworks_base-cbcbb828e8e3d1f901be00c896d816d01c17b19d.tar.gz frameworks_base-cbcbb828e8e3d1f901be00c896d816d01c17b19d.tar.bz2 |
Merge "Prevent NPE in MediaSessionService" into mnc-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/media/MediaSessionService.java | 5 |
1 files changed, 3 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 65949bf..8086461 100644 --- a/services/core/java/com/android/server/media/MediaSessionService.java +++ b/services/core/java/com/android/server/media/MediaSessionService.java @@ -765,8 +765,9 @@ public class MediaSessionService extends SystemService implements Monitor { // If we don't have a media button receiver to fall back on // include non-playing sessions for dispatching UserRecord ur = mUserRecords.get(ActivityManager.getCurrentUser()); - boolean useNotPlayingSessions = ur.mLastMediaButtonReceiver == null - && ur.mRestoredMediaButtonReceiver == null; + boolean useNotPlayingSessions = (ur == null) || + (ur.mLastMediaButtonReceiver == null + && ur.mRestoredMediaButtonReceiver == null); MediaSessionRecord session = mPriorityStack .getDefaultMediaButtonSession(mCurrentUserId, useNotPlayingSessions); if (isVoiceKey(keyEvent.getKeyCode())) { |