Loading services/core/java/com/android/server/media/MediaSessionRecord.java +7 −10 Original line number Diff line number Diff line Loading @@ -259,24 +259,24 @@ public class MediaSessionRecord extends MediaSessionRecordImpl implements IBinde private static final int USER_ENGAGEMENT_UNSET = -1; /** * Indicates that the session is {@linkplain MediaSession#isActive() active} and in one of the * {@linkplain PlaybackState#isActive() active states}. * Indicates that the session is in one of the {@linkplain PlaybackState#isActive() active * states}. * * @see #updateUserEngagedStateIfNeededLocked(boolean, boolean) */ private static final int USER_PERMANENTLY_ENGAGED = 0; /** * Indicates that the session is {@linkplain MediaSession#isActive() active} and has recently * switched to one of the {@linkplain PlaybackState#isActive() inactive states}. * Indicates that the session has recently switched to one of the {@linkplain * PlaybackState#isActive() inactive states}. * * @see #updateUserEngagedStateIfNeededLocked(boolean, boolean) */ private static final int USER_TEMPORARILY_ENGAGED = 1; /** * Indicates that the session is either not {@linkplain MediaSession#isActive() active} or in * one of the {@linkplain PlaybackState#isActive() inactive states}. * Indicates that the session is in one of the {@linkplain PlaybackState#isActive() inactive * states}. * * @see #updateUserEngagedStateIfNeededLocked(boolean, boolean) */ Loading Loading @@ -1299,11 +1299,8 @@ public class MediaSessionRecord extends MediaSessionRecordImpl implements IBinde callingUid, callingPid); } boolean isGlobalPrioritySessionActive = mService.isGlobalPrioritySessionActive(); synchronized (mLock) { mIsActive = active; updateUserEngagedStateIfNeededLocked( /* isTimeoutExpired= */ false, isGlobalPrioritySessionActive); } final long token = Binder.clearCallingIdentity(); try { Loading Loading @@ -1597,7 +1594,7 @@ public class MediaSessionRecord extends MediaSessionRecordImpl implements IBinde } int oldUserEngagedState = mUserEngagementState; int newUserEngagedState; if (isActive() && mPlaybackState != null && mPlaybackState.isActive()) { if (mPlaybackState != null && mPlaybackState.isActive()) { newUserEngagedState = USER_PERMANENTLY_ENGAGED; } else if (oldUserEngagedState == USER_PERMANENTLY_ENGAGED || oldUserEngagedState == USER_ENGAGEMENT_UNSET Loading services/core/java/com/android/server/media/MediaSessionService.java +1 −1 Original line number Diff line number Diff line Loading @@ -395,7 +395,7 @@ public class MediaSessionService extends SystemService implements Monitor { // MediaSession2 case return record.checkPlaybackActiveState(/* expected= */ true); } return playbackState.isActive() && record.isActive(); return playbackState.isActive(); } // Currently only media1 can become global priority session. Loading Loading
services/core/java/com/android/server/media/MediaSessionRecord.java +7 −10 Original line number Diff line number Diff line Loading @@ -259,24 +259,24 @@ public class MediaSessionRecord extends MediaSessionRecordImpl implements IBinde private static final int USER_ENGAGEMENT_UNSET = -1; /** * Indicates that the session is {@linkplain MediaSession#isActive() active} and in one of the * {@linkplain PlaybackState#isActive() active states}. * Indicates that the session is in one of the {@linkplain PlaybackState#isActive() active * states}. * * @see #updateUserEngagedStateIfNeededLocked(boolean, boolean) */ private static final int USER_PERMANENTLY_ENGAGED = 0; /** * Indicates that the session is {@linkplain MediaSession#isActive() active} and has recently * switched to one of the {@linkplain PlaybackState#isActive() inactive states}. * Indicates that the session has recently switched to one of the {@linkplain * PlaybackState#isActive() inactive states}. * * @see #updateUserEngagedStateIfNeededLocked(boolean, boolean) */ private static final int USER_TEMPORARILY_ENGAGED = 1; /** * Indicates that the session is either not {@linkplain MediaSession#isActive() active} or in * one of the {@linkplain PlaybackState#isActive() inactive states}. * Indicates that the session is in one of the {@linkplain PlaybackState#isActive() inactive * states}. * * @see #updateUserEngagedStateIfNeededLocked(boolean, boolean) */ Loading Loading @@ -1299,11 +1299,8 @@ public class MediaSessionRecord extends MediaSessionRecordImpl implements IBinde callingUid, callingPid); } boolean isGlobalPrioritySessionActive = mService.isGlobalPrioritySessionActive(); synchronized (mLock) { mIsActive = active; updateUserEngagedStateIfNeededLocked( /* isTimeoutExpired= */ false, isGlobalPrioritySessionActive); } final long token = Binder.clearCallingIdentity(); try { Loading Loading @@ -1597,7 +1594,7 @@ public class MediaSessionRecord extends MediaSessionRecordImpl implements IBinde } int oldUserEngagedState = mUserEngagementState; int newUserEngagedState; if (isActive() && mPlaybackState != null && mPlaybackState.isActive()) { if (mPlaybackState != null && mPlaybackState.isActive()) { newUserEngagedState = USER_PERMANENTLY_ENGAGED; } else if (oldUserEngagedState == USER_PERMANENTLY_ENGAGED || oldUserEngagedState == USER_ENGAGEMENT_UNSET Loading
services/core/java/com/android/server/media/MediaSessionService.java +1 −1 Original line number Diff line number Diff line Loading @@ -395,7 +395,7 @@ public class MediaSessionService extends SystemService implements Monitor { // MediaSession2 case return record.checkPlaybackActiveState(/* expected= */ true); } return playbackState.isActive() && record.isActive(); return playbackState.isActive(); } // Currently only media1 can become global priority session. Loading