* It also supports the API to set the display brightness.
* Application can receive the display event by callback function from the system.
*
+ * @section CAPI_SYSTEM_DEVICE_DISPLAY_MODULE__FEATURE Related Features
+ * This API is related with the following features:\n
+ * - %http://tizen.org/feature/display.state\n
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ *
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ *
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ *
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature List</b>.</a>
+ *
*/
/**
* 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.
*
+ * @section CAPI_SYSTEM_DEVICE_POWER_MODULE__FEATURE Related Features
+ * This API is related with the following features:\n
+ * - %http://tizen.org/feature/display.state\n
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ *
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ *
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ *
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature List</b>.</a>
+ *
*/
/**
* @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
* @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
+ * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
* @see device_power_request_lock()
* @see device_power_release_lock()
* @see device_add_callback
* @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
* @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
+ * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
* @post The device will be in #DISPLAY_STATE_NORMAL state.
*/
int device_power_wakeup(bool dim) TIZEN_DEPRECATED_API;
#define MODEL_NAME "http://tizen.org/system/model_name"
#define MODEL_EMULATOR "Emulator"
+#define DISPLAY_STATE_FEATURE "http://tizen.org/feature/display.state"
static inline char *trim_str(char *s)
{
return emul;
}
+
+int is_display_state_supported(void)
+{
+ int ret;
+ bool display_state_avail;
+
+ ret = system_info_get_platform_bool(DISPLAY_STATE_FEATURE, &display_state_avail);
+ if (ret < 0) {
+ _E("Failed to get value of display state feature");
+ return false;
+ } else if (ret == 0 && !display_state_avail) {
+ _D("Display state feature is not supported");
+ return false;
+ } else
+ return true;
+}
#define TIZEN_FEATURE_TRACKER (_get_tizen_profile() == TIZEN_PROFILE_TV)
bool is_emulator(void);
+int is_display_state_supported(void);
#endif /* __COMMON_H__ */
int ret;
static int privilege = -1;
+ ret = is_display_state_supported();
+ if (!ret)
+ return DEVICE_ERROR_NOT_SUPPORTED;
+
if (check_async_call_rate() < 0) {
_E("Rejected by too frequent calls; %d (calls per sec.) limit is violated."
, CHECK_RATE_THRESHOLD);
int device_power_wakeup(bool dim)
{
+ int ret;
+
+ ret = is_display_state_supported();
+ if (!ret)
+ return DEVICE_ERROR_NOT_SUPPORTED;
+
if (dim)
return device_display_change_state(DISPLAY_STATE_SCREEN_DIM);