public class SensorNotificationService extends SystemService implements SensorEventListener
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 |
---|
SensorNotificationService(Context context) |
Modifier and Type | Method and Description |
---|---|
void |
onAccuracyChanged(Sensor sensor,
int accuracy)
Called when the accuracy of the registered sensor has changed.
|
void |
onBootPhase(int phase)
Called on each phase of the boot process.
|
void |
onSensorChanged(SensorEvent event)
Called when there is a new sensor event.
|
void |
onStart()
Called when the dependencies listed in the @Service class-annotation are available
and after the chosen start phase.
|
getBinderService, getContext, getLocalService, isSafeMode, onCleanupUser, onStartUser, onStopUser, onSwitchUser, onUnlockUser, publishBinderService, publishBinderService, publishLocalService
public SensorNotificationService(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 onSensorChanged(SensorEvent event)
SensorEventListener
See SensorManager
for details on possible sensor types.
See also SensorEvent
.
NOTE: The application doesn't own the
event
object passed as a parameter and therefore cannot hold on to it.
The object may be part of an internal pool and may be reused by
the framework.
onSensorChanged
in interface SensorEventListener
event
- the SensorEvent
.public void onAccuracyChanged(Sensor sensor, int accuracy)
SensorEventListener
See the SENSOR_STATUS_* constants in
SensorManager
for details.
onAccuracyChanged
in interface SensorEventListener
accuracy
- The new accuracy of this sensor, one of
SensorManager.SENSOR_STATUS_*