public class MediaSessionService extends SystemService implements Watchdog.Monitor
PHASE_ACTIVITY_MANAGER_READY, PHASE_BOOT_COMPLETED, PHASE_LOCK_SETTINGS_READY, PHASE_SYSTEM_SERVICES_READY, PHASE_THIRD_PARTY_APPS_CAN_START, PHASE_WAIT_FOR_DEFAULT_DISPLAY
Constructor and Description |
---|
MediaSessionService(Context context) |
Modifier and Type | Method and Description |
---|---|
protected void |
enforcePhoneStatePermission(int pid,
int uid) |
void |
monitor() |
void |
notifyRemoteVolumeChanged(int flags,
MediaSessionRecord session)
Tells the system UI that volume has changed on a remote session.
|
void |
onSessionPlaybackTypeChanged(MediaSessionRecord record) |
void |
onSessionPlaystateChange(MediaSessionRecord record,
int oldState,
int newState) |
void |
onStart()
Called when the dependencies listed in the @Service class-annotation are available
and after the chosen start phase.
|
void |
onStartUser(int userId)
Called when a new user is starting, for system services to initialize any per-user
state they maintain for running users.
|
void |
onStopUser(int userId)
Called when an existing user is stopping, for system services to finalize any per-user
state they maintain for running users.
|
void |
onSwitchUser(int userId)
Called when switching to a different foreground user, for system services that have
special behavior for whichever user is currently in the foreground.
|
void |
updateSession(MediaSessionRecord record) |
getBinderService, getContext, getLocalService, isSafeMode, onBootPhase, onCleanupUser, onUnlockUser, publishBinderService, publishBinderService, publishLocalService
public MediaSessionService(Context context)
public void onStart()
SystemService
onStart
in class SystemService
public void updateSession(MediaSessionRecord record)
public void notifyRemoteVolumeChanged(int flags, MediaSessionRecord session)
public void onSessionPlaystateChange(MediaSessionRecord record, int oldState, int newState)
public void onSessionPlaybackTypeChanged(MediaSessionRecord record)
public void onStartUser(int userId)
SystemService
onStartUser
in class SystemService
userId
- The identifier of the user.public void onSwitchUser(int userId)
SystemService
onSwitchUser
in class SystemService
userId
- The identifier of the user.public void onStopUser(int userId)
SystemService
onStopUser
in class SystemService
userId
- The identifier of the user.public void monitor()
monitor
in interface Watchdog.Monitor
protected void enforcePhoneStatePermission(int pid, int uid)