Do not allow to uninstall 'not removable apps' 77/110877/1 accepted/tizen_4.0_unified accepted/tizen_5.0_unified accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix accepted/tizen_6.0_unified_hotfix accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_tv accepted/tizen_unified tizen_4.0 tizen_5.0 tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/4.0/unified/20170816.014200 accepted/tizen/4.0/unified/20170828.222036 accepted/tizen/5.0/unified/20181106.201604 accepted/tizen/5.5/unified/20191031.032814 accepted/tizen/5.5/unified/mobile/hotfix/20201027.070812 accepted/tizen/5.5/unified/wearable/hotfix/20201027.094504 accepted/tizen/6.0/unified/hotfix/20201103.045217 accepted/tizen/7.0/unified/20221110.055929 accepted/tizen/7.0/unified/hotfix/20221116.112002 accepted/tizen/8.0/unified/20231005.100101 accepted/tizen/tv/20170118.223606 accepted/tizen/unified/20170309.074725 submit/tizen/20170118.102121 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100008 submit/tizen_4.0_unified/20170814.115522 submit/tizen_5.0/20181101.000009 submit/tizen_5.0/20181106.000001 submit/tizen_5.5/20191031.000009 submit/tizen_5.5/20191031.000011 submit/tizen_5.5/20191031.000013 submit/tizen_5.5_mobile_hotfix/20201026.185109 submit/tizen_5.5_wearable_hotfix/20201026.184309 submit/tizen_6.0/20201029.205505 submit/tizen_6.0_hotfix/20201102.192905 submit/tizen_6.0_hotfix/20201103.115105 submit/tizen_6.5/20211028.164001 submit/tizen_6.5/20211029.140001 submit/tizen_unified/20170308.100418 submit/tizen_unified/20170309.100417 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m1_release tizen_4.0.m2_release tizen_5.5.m2_release tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorKyuho Jo <kyuho.jo@samsung.com>
Wed, 18 Jan 2017 10:09:18 +0000 (19:09 +0900)
committerKyuho Jo <kyuho.jo@samsung.com>
Wed, 18 Jan 2017 10:09:18 +0000 (19:09 +0900)
Change-Id: Ia0a09db95e96d883ffe1542263066b037702b78a
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
include/data/app.h
packaging/org.tizen.apps.spec
src/data/app.c
src/view/view_base.c

index d71e112..b0d9e76 100644 (file)
@@ -34,6 +34,7 @@ char *get_pkg_id(struct app_data *adata);
 char *get_app_name(struct app_data *adata);
 char *get_app_icon(struct app_data *adata);
 char *get_pkg_type(struct app_data *adata);
+bool get_app_removable(struct app_data *adata);
 bool get_app_favorite(struct app_data *adata, bool *isfavorite);
 bool set_app_favorite(struct app_data *adata, bool isfavorite);
 bool get_app_icon_bg_color(struct app_data *adata,
index 205b620..bf302e7 100644 (file)
@@ -1,6 +1,6 @@
 Name: org.tizen.apps
 Summary: Apps application for Tizen TV based on AirFlex UX
-Version: 0.2
+Version: 0.3.1
 Release: 1
 Group: Applications/Core Applications
 License: Apache-2.0
index fb05b3a..7f6b00c 100644 (file)
@@ -29,6 +29,7 @@ struct app_data {
        char *name;
        char *icon;
        char *pkgtype;
+       bool removable;
        struct color_data icon_bg;
        struct color_data text_bg;
 };
@@ -48,6 +49,7 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data)
        char *appid, *pkgid, *name, *icon, *pkgtype;
        pkgmgrinfo_pkginfo_h pkginfo_h;
        bool nodisplay;
+       bool removable = true;
 
        if (!data)
                return -1;
@@ -76,6 +78,9 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data)
                                &pkginfo_h) != PMINFO_R_OK)
                return 0;
 
+       if (pkgmgrinfo_pkginfo_is_removable(pkginfo_h, &removable) != PMINFO_R_OK)
+               return 0;
+
        if (pkgmgrinfo_pkginfo_get_type(pkginfo_h, &pkgtype) != PMINFO_R_OK) {
                pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h);
                return 0;
@@ -113,6 +118,8 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data)
        if (pkgtype)
                adata->pkgtype = strdup(pkgtype);
 
+       adata->removable = removable;
+
        *list = eina_list_append(*list, adata);
 
 OUT:
@@ -181,6 +188,16 @@ char *get_pkg_type(struct app_data *adata)
        return adata->pkgtype;
 }
 
+bool get_app_removable(struct app_data *adata)
+{
+       if (!adata) {
+               _ERR("Invalid argument.");
+               return NULL;
+       }
+
+       return adata->removable;
+}
+
 bool get_app_favorite(struct app_data *adata,  bool *isfavorite)
 {
        int r;
index 21f3247..9242919 100644 (file)
@@ -155,6 +155,11 @@ static void _draw_uninstall_popup(struct _priv *priv)
                return;
        }
 
+       if (get_app_removable(adata) == false) {
+               utils_add_notify(priv->base, "This application is not removable", STYLE_TOAST, STYLE_TOAST, 3);
+               return;
+       }
+
        name = get_app_name(adata);
        if (!name)
                return;