diff options
author | Kyuho Jo <kyuho.jo@samsung.com> | 2017-01-18 19:09:18 +0900 |
---|---|---|
committer | Kyuho Jo <kyuho.jo@samsung.com> | 2017-01-18 19:09:18 +0900 |
commit | 0d9aace8b36d754e3d549b79b78ddb3182e003ae (patch) | |
tree | b523e4d63a3905daae17d2edd296679a56ee210c | |
parent | 768d061bc351a7829dbd368dcf151250dea887c0 (diff) | |
download | air_apps-0d9aace8b36d754e3d549b79b78ddb3182e003ae.tar.gz air_apps-0d9aace8b36d754e3d549b79b78ddb3182e003ae.tar.bz2 air_apps-0d9aace8b36d754e3d549b79b78ddb3182e003ae.zip |
Do not allow to uninstall 'not removable apps'tizen_8.0_m2_releasetizen_7.0_m2_releasetizen_6.5.m2_releasetizen_6.0.m2_releasetizen_5.5.m2_releasetizen_4.0.m2_releasetizen_4.0.m1_releasetizen_4.0.IoT.p2_releasetizen_4.0.IoT.p1_releasesubmit/tizen_unified/20170309.100417submit/tizen_unified/20170308.100418submit/tizen_6.5/20211029.140001submit/tizen_6.5/20211028.164001submit/tizen_6.0_hotfix/20201103.115105submit/tizen_6.0_hotfix/20201102.192905submit/tizen_6.0/20201029.205505submit/tizen_5.5_wearable_hotfix/20201026.184309submit/tizen_5.5_mobile_hotfix/20201026.185109submit/tizen_5.5/20191031.000013submit/tizen_5.5/20191031.000011submit/tizen_5.5/20191031.000009submit/tizen_5.0/20181106.000001submit/tizen_5.0/20181101.000009submit/tizen_4.0_unified/20170814.115522submit/tizen_4.0/20170828.100008submit/tizen_4.0/20170814.115522submit/tizen_4.0/20170811.094300submit/tizen/20170118.102121accepted/tizen/unified/20170309.074725accepted/tizen/tv/20170118.223606accepted/tizen/8.0/unified/20231005.100101accepted/tizen/7.0/unified/hotfix/20221116.112002accepted/tizen/7.0/unified/20221110.055929accepted/tizen/6.0/unified/hotfix/20201103.045217accepted/tizen/5.5/unified/wearable/hotfix/20201027.094504accepted/tizen/5.5/unified/mobile/hotfix/20201027.070812accepted/tizen/5.5/unified/20191031.032814accepted/tizen/5.0/unified/20181106.201604accepted/tizen/4.0/unified/20170828.222036accepted/tizen/4.0/unified/20170816.014200tizen_8.0tizen_7.0_hotfixtizen_7.0tizen_6.5tizen_6.0_hotfixtizen_6.0tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixtizen_5.5tizen_5.0tizen_4.0accepted/tizen_unifiedaccepted/tizen_tvaccepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unifiedaccepted/tizen_5.0_unifiedaccepted/tizen_4.0_unified
Change-Id: Ia0a09db95e96d883ffe1542263066b037702b78a
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
-rw-r--r-- | include/data/app.h | 1 | ||||
-rw-r--r-- | packaging/org.tizen.apps.spec | 2 | ||||
-rw-r--r-- | src/data/app.c | 17 | ||||
-rw-r--r-- | src/view/view_base.c | 5 |
4 files changed, 24 insertions, 1 deletions
diff --git a/include/data/app.h b/include/data/app.h index d71e112..b0d9e76 100644 --- a/include/data/app.h +++ b/include/data/app.h @@ -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, diff --git a/packaging/org.tizen.apps.spec b/packaging/org.tizen.apps.spec index 205b620..bf302e7 100644 --- a/packaging/org.tizen.apps.spec +++ b/packaging/org.tizen.apps.spec @@ -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 diff --git a/src/data/app.c b/src/data/app.c index fb05b3a..7f6b00c 100644 --- a/src/data/app.c +++ b/src/data/app.c @@ -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; diff --git a/src/view/view_base.c b/src/view/view_base.c index 21f3247..9242919 100644 --- a/src/view/view_base.c +++ b/src/view/view_base.c @@ -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; |