From: Yunhee Seo Date: Wed, 10 Jan 2024 06:41:38 +0000 (+0900) Subject: [ITC][UTC][device][Non-ACR][Add Exception handling for unavailable display state] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F304247%2F1;p=test%2Ftct%2Fnative%2Fapi.git [ITC][UTC][device][Non-ACR][Add Exception handling for unavailable display state] The availability of DISPLAY_STATE_SCREEN_DIM state varies depending on the profile and usage. Thus, DISPLAY_STATE_SCREEN_DIM state handling code has been added to enable testing without profile dependence. Change-Id: I932ac0128f80be8e2cb3c671540f65acbf16a4da Signed-off-by: Yunhee Seo --- diff --git a/src/itc/device/ITs-device.c b/src/itc/device/ITs-device.c index e0c165c6f..b3ebcfa50 100644 --- a/src/itc/device/ITs-device.c +++ b/src/itc/device/ITs-device.c @@ -226,14 +226,13 @@ int ITc_device_add_remove_callback_p(void) //Get current display state device_display_get_state(&display_state); -#if (defined(MOBILE) || defined(TIZENIOT)) //Starts MOBILE or TIZENIOT display_state_e display_states[] = { DISPLAY_STATE_NORMAL, DISPLAY_STATE_SCREEN_DIM, DISPLAY_STATE_SCREEN_OFF }; -#endif // End MOBILE or TIZENIOT -#if defined(TV) || defined(WEARABLE) - display_state_e display_states[] = { DISPLAY_STATE_NORMAL, DISPLAY_STATE_SCREEN_OFF }; -#endif - int states_size = sizeof(display_states) / sizeof(display_states[0]); + int states_size = 3; int states_counter = 0; + int dim_supported = 0; + + dim_supported = device_display_change_state(DISPLAY_STATE_SCREEN_DIM); + for ( states_counter = 0; states_counter < states_size; states_counter++ ) { // Make change to the current display state @@ -241,6 +240,8 @@ int ITc_device_add_remove_callback_p(void) //{ // break; //} + if ( display_states[states_counter] == DISPLAY_STATE_SCREEN_DIM && dim_supported == DEVICE_ERROR_INVALID_PARAMETER) + continue; if ( display_state != display_states[states_counter] ) { diff --git a/src/itc/device/ITs-device_display.c b/src/itc/device/ITs-device_display.c index 5999bbe94..69b73cc41 100644 --- a/src/itc/device/ITs-device_display.c +++ b/src/itc/device/ITs-device_display.c @@ -225,19 +225,21 @@ int ITc_device_display_change_get_state_p(void) START_TEST; display_state_e getDisplayState; -#if (defined(MOBILE) || defined(TIZENIOT)) //Starts MOBILE or TIZENIOT display_state_e display_states[] = { DISPLAY_STATE_NORMAL,DISPLAY_STATE_SCREEN_DIM,DISPLAY_STATE_SCREEN_OFF}; -#endif // End MOBILE or TIZENIOT -#if defined(TV) || defined(WEARABLE) - display_state_e display_states[] = { DISPLAY_STATE_NORMAL,DISPLAY_STATE_SCREEN_OFF}; -#endif - int enum_size = sizeof(display_states) / sizeof(display_states[0]); + int enum_size = 3; int enum_counter = 0; + int dim_supported = 0; + + dim_supported = device_display_change_state(DISPLAY_STATE_SCREEN_DIM); for ( enum_counter=0; enum_counter