osso.DeviceState
The LibOSSO DeviceState object.
Constructor
Creates a new osso.DeviceState
based on the osso.Context object.
osso.DeviceState(context)
|
|
---|---|
context |
The OSSO Context object related to the application. |
Returns | A device state object to use in later calls to this library. None is returned if an error happened. |
Methods in this group offer a convenient way to receive device status information from lower levels of the system.
display_state_on
Request to turn on the display as if the user had pressed a key or the touch screen. This can be used after completing a long operation such as downloading a large file or after retrieving e-mails.
osso.DeviceState.display_state_on()
|
---|
display_blanking_pause
Request not to blank the display. This method must be called again within 60 seconds to renew the request. The method is used, for example, by the video player during video playback. Also prevents suspending the device.
osso.DeviceState.display_blanking_pause()
|
---|
set_device_state_callback
This method registers a callback function that is called whenever the state device changes. The first call to this method will also check the current state of the device, and if the state is available, the corresponding callback function will be called immediately. Callback function will receive the shutdown, save_data, memory_low, system_inactivity, mode and user_data parameters with state device. If you specify shutdown, save_data, memory_low, system_inactivity (booleans) or mode ('normal', 'flight', 'invalid', 'offline') the callback function will be called only when this state changes. Use None in callback parameter to unset this callback.
Improve this page