Fix N_SE-13547 and N_SE-13516
authorKairong Yin <kairong78.yin@samsung.com>
Tue, 20 Nov 2012 10:29:26 +0000 (02:29 -0800)
committerKairong Yin <kairong78.yin@samsung.com>
Thu, 22 Nov 2012 06:04:47 +0000 (22:04 -0800)
Change-Id: I1be73c447ddcffa77b35a44fbc72153ac3aa9c97

src/setting.c

index 49f09be..c702afb 100755 (executable)
@@ -422,6 +422,15 @@ static void setting_other_vconf_change_cb(keynode_t *key, void *data)
                item_to_update->chk_status = !status;
                //do not need delay for checks
                elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
+               SETTING_TRACE("item_to_update->chk_status:%d", item_to_update->chk_status);
+               if (item_to_update->chk_status) //rotation function is not blocked
+               {
+                       SETTING_TRACE("Rotation function is on, it is necessary to adjust the device orientation");
+                       int mode = APP_DEVICE_ORIENTATION_0;
+                       mode = app_get_device_orientation();
+                       elm_win_rotation_with_resize_set(ad->win_main, mode);
+               }
+
                return;
        } else if (!safeStrCmp(vconf_name, VCONFKEY_NFC_STATE)) {
                SETTING_TRACE_DEBUG("%s updated", vconf_name);
@@ -840,6 +849,17 @@ static int setting_main_app_reset(service_h service, void *data)
        SETTING_TRACE_BEGIN;
        setting_main_appdata *ad = data;
 
+       int value = 0;
+       vconf_get_bool (VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, &value);
+       SETTING_TRACE("value:%d", value);
+       if (!value) //rotation function is not blocked
+       {
+               SETTING_TRACE("Rotation function is on, it is necessary to adjust the device orientation");
+               int mode = APP_DEVICE_ORIENTATION_0;
+               mode = app_get_device_orientation();
+               elm_win_rotation_with_resize_set(ad->win_main, mode);
+       }
+
 #if SUPPORT_LIVEBOX_DEMO
        char *ug_name = NULL;
        if(b != NULL)