[TIZEN_3.0 UX Impl] Added saving logic for gallery state 94/87994/1 submit/tizen_mobile/20160914.112530
authorRahul Dadhich <r.dadhich@samsung.com>
Mon, 12 Sep 2016 11:45:24 +0000 (17:15 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Mon, 12 Sep 2016 11:45:24 +0000 (17:15 +0530)
Change-Id: Ie67c9f1569b69407b574e7e96dcdc31892b36895
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
src/util/gl-util.c
tizen-manifest.xml

index a0a6fed..807738e 100644 (file)
@@ -2508,12 +2508,39 @@ char *_gl_get_root_directory_path(int storage_type)
        return path;
 }
 
+static void _gl_save_state_in_ini_file(char *data)
+{
+       char  *path_gallery = app_get_shared_data_path();
+       if (!path_gallery) {
+               gl_dbg("shared data path is null");
+               return;
+       }
+       gl_dbg("shared data path is : %s", path_gallery);
+       char launch_state[1024] = {0};
+       snprintf(launch_state, 1024, "%s%s", path_gallery, "state.ini");
+       free(path_gallery);
+
+       FILE *fp = fopen(launch_state, "w");
+
+       if (fp == NULL) {
+               gl_dbg("Failed to open ini file. : %s", launch_state);
+               return ;
+       }
+       fprintf(fp, "state=%s", data);
+       if (fp) {
+               fclose(fp);
+       }
+
+}
+
 void _gl_set_launch_state_preference(void *data)
 {
        int ret;
        if (gl_get_view_mode(data) == GL_VIEW_TIMELINE) {
+               _gl_save_state_in_ini_file("Time");
                ret = preference_set_boolean(GL_LAUNCH_STATE, true);
        } else {
+               _gl_save_state_in_ini_file("Album");
                ret = preference_set_boolean(GL_LAUNCH_STATE, false);
        }
        if (ret != PREFERENCE_ERROR_NONE) {
index b190565..84bf0ce 100644 (file)
         <icon>org.tizen.gallery.png</icon>
     </ui-application>
     <privileges>
-               <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
-               <privilege>http://tizen.org/privilege/externalstorage</privilege>
-               <privilege>http://tizen.org/privilege/content.write</privilege>
-               <privilege>http://tizen.org/privilege/mediastorage</privilege>
-       </privileges>
+        <privilege>http://tizen.org/privilege/mediastorage</privilege>
+        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        <privilege>http://tizen.org/privilege/externalstorage</privilege>
+        <privilege>http://tizen.org/privilege/content.write</privilege>
+        <privilege>http://tizen.org/privilege/appdir.shareddata</privilege>
+    </privileges>
 </manifest>