The Power API provides functions to control the power service.
Required Header
#include <device/power.h>
Overview
The Power API provides the way to control the power service. It can be made to hold the specific state to avoid changing display and CPU state internally.
Enumeration Type Documentation
Enumeration for lock type.
Each enum ensures that the suitable device is on until all the lock requests have been released or after a timeout.
Enum Type | CPU | Brightness(Display) |
POWER_LOCK_CPU | ON | OFF |
POWER_LOCK_DISPLAY | ON | ON(Normal) |
POWER_LOCK_DISPLAY_DIM | ON | ON(Dim) |
The POWER_LOCK_DISPLAY and POWER_LOCK_DISPLAY_DIM types were deprecated in Tizen 2.4.
Please use below api set instead of these types.
int efl_util_set_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e mode);
int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode);
- Since :
- 2.3
- Enumerator:
POWER_LOCK_CPU |
CPU lock
|
POWER_LOCK_DISPLAY |
Display normal lock (Deprecated since 2.4. Use efl_util_set_window_screen_mode() instead)
|
POWER_LOCK_DISPLAY_DIM |
Display dim lock (Deprecated since 2.4. Use efl_util_set_window_screen_mode() instead)
|
Function Documentation
Reboots the device.
- Warning:
- This is not for use by third-party applications.
Will not return if the reboot is successful.
It operates asynchronously.
- Since :
- 2.3.1
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/reboot
- Parameters:
-
[in] | reason | Pass to the platform and kernel to request special reboot reason, or null |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Releases the given lock state which was locked before.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/display
- Parameters:
-
[in] | type | The power type to release lock |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- device_power_request_lock()
Locks the given lock state for a specified time.
After the given timeout_ms (in milliseconds), unlock the given lock state automatically.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/display
- Parameters:
-
[in] | type | The power type to request lock |
[in] | timeout_ms | The positive number in milliseconds or 0 for permanent lock
So you must release the permanent lock of power state with device_power_release_lock() if timeout_ms is zero |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- device_power_release_lock()
Changes the current power state to the normal/dim state.
- Deprecated:
- Deprecated Since 2.4
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/display
- Parameters:
-
[in] | dim | Set true to set the dim state, otherwise set false to not set the dim state |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Postcondition:
- The device will be in DISPLAY_STATE_NORMAL state.