public final class NightDisplayService extends SystemService implements NightDisplayController.Callback
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 |
---|
NightDisplayService(Context context) |
Modifier and Type | Method and Description |
---|---|
void |
onActivated(boolean activated)
Callback invoked when the activated state changes.
|
void |
onAutoModeChanged(int autoMode)
Callback invoked when the auto mode changes.
|
void |
onBootPhase(int phase)
Called on each phase of the boot process.
|
void |
onCustomEndTimeChanged(NightDisplayController.LocalTime endTime)
Callback invoked when the time to automatically deactivate Night display changes.
|
void |
onCustomStartTimeChanged(NightDisplayController.LocalTime startTime)
Callback invoked when the time to automatically activate Night display changes.
|
void |
onStart()
Called when the dependencies listed in the @Service class-annotation are available
and after the chosen start phase.
|
void |
onStartUser(int userHandle)
Called when a new user is starting, for system services to initialize any per-user
state they maintain for running users.
|
void |
onStopUser(int userHandle)
Called when an existing user is stopping, for system services to finalize any per-user
state they maintain for running users.
|
void |
onSwitchUser(int userHandle)
Called when switching to a different foreground user, for system services that have
special behavior for whichever user is currently in the foreground.
|
getBinderService, getContext, getLocalService, isSafeMode, onCleanupUser, onUnlockUser, publishBinderService, publishBinderService, publishLocalService
public NightDisplayService(Context context)
public void onStart()
SystemService
onStart
in class SystemService
public void onBootPhase(int phase)
SystemService
onBootPhase
in class SystemService
phase
- The current boot phase.public void onStartUser(int userHandle)
SystemService
onStartUser
in class SystemService
userHandle
- The identifier of the user.public void onSwitchUser(int userHandle)
SystemService
onSwitchUser
in class SystemService
userHandle
- The identifier of the user.public void onStopUser(int userHandle)
SystemService
onStopUser
in class SystemService
userHandle
- The identifier of the user.public void onActivated(boolean activated)
NightDisplayController.Callback
onActivated
in interface NightDisplayController.Callback
activated
- true
if Night display is activatedpublic void onAutoModeChanged(int autoMode)
NightDisplayController.Callback
onAutoModeChanged
in interface NightDisplayController.Callback
autoMode
- the auto mode to usepublic void onCustomStartTimeChanged(NightDisplayController.LocalTime startTime)
NightDisplayController.Callback
onCustomStartTimeChanged
in interface NightDisplayController.Callback
startTime
- the local time to automatically activate Night displaypublic void onCustomEndTimeChanged(NightDisplayController.LocalTime endTime)
NightDisplayController.Callback
onCustomEndTimeChanged
in interface NightDisplayController.Callback
endTime
- the local time to automatically deactivate Night display