[CTC][Platform-permission][NonACR][6.5 Apply display feature for iot profile] 67/254167/3
authorlokilee73 <changjoo.lee@samsung.com>
Wed, 24 Feb 2021 08:16:51 +0000 (17:16 +0900)
committershobhit verma <shobhit.v@samsung.com>
Wed, 24 Feb 2021 09:50:41 +0000 (09:50 +0000)
Change-Id: I05b167b56090924fa3d8160ea853153ed9931353
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
src/ctc/platform-permission/CTs-platform-permission-device.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 8e8e635..28e170e
@@ -10,6 +10,7 @@
 #define LED_FEATURE                            "http://tizen.org/feature/led"
 #define IR_FEATURE                             "http://tizen.org/feature/consumer_ir"
 #define BATTERY_FEATURE                                "http://tizen.org/feature/battery"
+#define DISPLAY_FEATURE_MAIN                   "http://tizen.org/feature/display"
 #define DISPLAY_STATE_FEATURE                  "http://tizen.org/feature/display.state"
 
 /**
@@ -425,10 +426,22 @@ int CTc_Device_PrivilegeLed_play_stop(void)
 int CTc_Device_PrivilegePower_request_release(void)
 {
        START_TEST;
+       static bool bIsDisplayFeatureSupported;
+       static bool bIsDisplayStateFeatureSupported;
+
+       IS_FEATURE_SUPPORTED(DISPLAY_FEATURE_MAIN, bIsDisplayFeatureSupported, API_NAMESPACE);
+       IS_FEATURE_SUPPORTED(DISPLAY_STATE_FEATURE, bIsDisplayStateFeatureSupported, API_NAMESPACE);
+
+       if ((bIsDisplayFeatureSupported == false) || (bIsDisplayStateFeatureSupported == false))
+       {
+               FPRINTF("[Line : %d][%s] Feature is not supported\\n", __LINE__, API_NAMESPACE);
+                       return 0;
+       }
+
        int nRet = device_power_request_lock(POWER_LOCK_DISPLAY, 10);
        if(nRet == DEVICE_ERROR_NONE)
-       device_power_release_lock(POWER_LOCK_DISPLAY);
-       PRINT_RESULT(TIZEN_ERROR_PERMISSION_DENIED, nRet, "device_haptic_get_count", DeviceGetError(nRet));
+               device_power_release_lock(POWER_LOCK_DISPLAY);
+       PRINT_RESULT(TIZEN_ERROR_PERMISSION_DENIED, nRet, "device_power_release_lock", DeviceGetError(nRet));
 
        return 0;
 }