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 <yuni.seo@samsung.com>
//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
//{
// break;
//}
+ if ( display_states[states_counter] == DISPLAY_STATE_SCREEN_DIM && dim_supported == DEVICE_ERROR_INVALID_PARAMETER)
+ continue;
if ( display_state != display_states[states_counter] )
{
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<enum_size; enum_counter++)
{
+ if (display_states[enum_counter] == DISPLAY_STATE_SCREEN_DIM && dim_supported == DEVICE_ERROR_INVALID_PARAMETER)
+ continue;
+
// Target API
int nRet = device_display_change_state(display_states[enum_counter]);
+
if (false == bIsDisplayFeatureSupported)
{
PRINT_RESULT(DEVICE_ERROR_NOT_SUPPORTED, nRet, "device_display_change_state", DeviceGetError(nRet));
#define DISPLAY_FEATURE "http://tizen.org/feature/display"
#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
-#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
+static display_state_e display_states[] = { DISPLAY_STATE_NORMAL,DISPLAY_STATE_SCREEN_DIM,DISPLAY_STATE_SCREEN_OFF};
static int cnt;
int utc_system_device_display_change_state_p(void)
{
int error, i;
+ int dim_supported = 0;
+
+ dim_supported = device_display_change_state(DISPLAY_STATE_SCREEN_DIM);
for (i = 0; i < ARRAY_SIZE(display_states); i++) {
+
+ if (display_states[i] == DISPLAY_STATE_SCREEN_DIM && dim_supported == DEVICE_ERROR_INVALID_PARAMETER)
+ continue;
+
error = device_display_change_state(display_states[i]);
if (g_DisplayFeature == true && g_DisplayStateFeature == true)
assert_eq(error, DEVICE_ERROR_NONE);