Add device_power_release_all_lock to forcely unlock LCD_NORMAL, LCD_DIM and LCD_OFF 46/208446/2 accepted/tizen/4.0/unified/20190624.224507 submit/tizen_4.0/20190624.113627
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 24 Jun 2019 09:07:31 +0000 (18:07 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 24 Jun 2019 09:15:40 +0000 (18:15 +0900)
Change-Id: I94aec2fd5800d8c1f024ceb5b5c05d2ae7c78604
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
include/power-internal.h [new file with mode: 0644]
include/power.h [changed mode: 0755->0644]
src/power.c

diff --git a/include/power-internal.h b/include/power-internal.h
new file mode 100644 (file)
index 0000000..c7c652f
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __TIZEN_SYSTEM_POWER_INTERNAL_H__
+#define __TIZEN_SYSTEM_POWER_INTERNAL_H__
+
+
+#include <stdbool.h>
+#include "device-error.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @addtogroup CAPI_SYSTEM_DEVICE_POWER_MODULE
+ * @{
+ */
+
+
+/**
+ * @brief Forcely releases LCD_NORMAL, LCD_DIM and LCD_OFF which were locked before.
+ * @since_tizen @if MOBILE 5.5 @elseif WEARABLE 5.5 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/display
+ * @param[in] type The power type to release lock
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #DEVICE_ERROR_NONE Successful
+ * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
+ * @see device_power_request_lock()
+ */
+int device_power_release_all_lock(void);
+
+
+/**
+ * @}
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif  // __TIZEN_SYSTEM_POWER_INTERNAL_H__
old mode 100755 (executable)
new mode 100644 (file)
index d0731fe..c99a8f1
@@ -21,6 +21,7 @@
 
 #include <stdbool.h>
 #include "device-error.h"
+#include "power-internal.h"
 
 
 #ifdef __cplusplus
index d3f6393d60e5969cfde2dd2713ebeaf2abadcf6a..88b7e3857f880e6e73584e8ee0a0e32c90d60301 100755 (executable)
@@ -45,6 +45,7 @@
 
 #define METHOD_LOCK_STATE       "lockstate"
 #define METHOD_UNLOCK_STATE     "unlockstate"
+#define METHOD_UNLOCK_ALL_STATE     "unlockallstate"
 #define METHOD_CHANGE_STATE     "changestate"
 #define METHOD_REBOOT           "Reboot"
 #define METHOD_REBOOT_WITH_OPTION "RebootWithOption"
@@ -467,6 +468,18 @@ int device_power_release_lock(power_lock_e type)
        return errno_to_device_error(ret);
 }
 
+int device_power_release_all_lock(void)
+{
+       int ret;
+
+       ret = dbus_method_sync(DEVICED_BUS_NAME,
+                       DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+                       METHOD_UNLOCK_ALL_STATE, NULL, NULL);
+//LCOV_EXCL_START System Error
+       return errno_to_device_error(ret);
+//LCOV_EXCL_STOP
+}
+
 int device_power_wakeup(bool dim)
 {
        if (dim)