remove unused vconf key. 31/42731/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150708.015023 accepted/tizen/tv/20150708.015126 accepted/tizen/wearable/20150708.015220 submit/tizen/20150630.051205 submit/tizen/20150702.103311 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorJiwoong Im <jiwoong.im@samsung.com>
Thu, 2 Jul 2015 02:48:48 +0000 (11:48 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Thu, 2 Jul 2015 02:48:48 +0000 (11:48 +0900)
- VCONFKEY_PKGMGR_STATUS

Change-Id: I4f831b0139a2b8721d011b18e1e95b541a7a08e2
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
plugin/app2sd/src/app2sd_interface.c
plugin/app2sd/src/app2sd_internals.c

index 089cd12..dba14c4 100755 (executable)
@@ -591,7 +591,7 @@ int app2sd_move_installed_app(const char *pkgid, GList* dir_list,
 
 END:
 
-       vconf_set_int(VCONFKEY_PKGMGR_STATUS, ret);
+       _app2sd_make_result_info_file((char*)pkgid, ret);
 
        return ret;
 }
index fe21eea..22fd099 100755 (executable)
@@ -1451,3 +1451,46 @@ FINISH_OFF:
        }
        return err_res;
 }
+
+void _app2sd_make_result_info_file(char *pkgid, int size)
+{
+       int ret = 0;
+       FILE* file = NULL;
+       int fd = 0;
+       char buf[FILENAME_MAX] = {0};
+       const char* app_info_label = "*";
+       char info_file[FILENAME_MAX] = {'\0', };
+
+       if(pkgid == NULL)
+               return;
+
+       snprintf(info_file, FILENAME_MAX, "/tmp/%s", pkgid);
+       app2ext_print("App2SD info : File path = %s\n", info_file);
+
+       file = fopen(info_file, "w");
+       if (file == NULL) {
+               app2ext_print("App2SD Error: Couldn't open the file %s \n", info_file);
+               return;
+       }
+
+       snprintf(buf, 128, "%d\n", size);
+       fwrite(buf, 1, strlen(buf), file);
+
+       fflush(file);
+       fd = fileno(file);
+       fsync(fd);
+       fclose(file);
+
+       if(lsetxattr(info_file, "security.SMACK64", app_info_label, strlen(app_info_label), 0)) {
+               app2ext_print("App2SD Error: error(%d) in setting smack label",errno);
+       }
+       ret = chmod(info_file, 0777);
+       if (ret == -1) {
+               return;
+       }
+
+       ret = chown(info_file, 5000, 5000);
+       if (ret == -1) {
+               return;
+       }
+}