Add Support for common profile genlist 13/232913/2 accepted/tizen/unified/20200510.220455 submit/tizen/20200508.090944
authorDewal Agarwal <d1.agarwal@samsung.com>
Fri, 8 May 2020 08:51:34 +0000 (14:21 +0530)
committerDewal Agarwal <d1.agarwal@samsung.com>
Fri, 8 May 2020 08:54:27 +0000 (14:24 +0530)
Change-Id: I43e639f122bf2e0c48f75278eab7a91b56e6f873
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
CMakeLists.txt
include/myaccount_ug_common.h
packaging/my-account.spec
src/myaccount_ug_account_list.c
src/myaccount_ug_addaccount.c
src/myaccount_ug_common.c

index 0cfab5d..61413f3 100755 (executable)
@@ -28,6 +28,7 @@ INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
        appcore-efl
        ui-gadget-1
+       capi-system-info
        accounts-svc
        capi-appfw-application
        vconf
index 507bccd..60023c5 100644 (file)
@@ -87,6 +87,8 @@ void myaccount_common_listen_pkgmgr_for_pkg_uninstall();
 \r
 int myaccount_common_get_account_type_count(const char* capability_filter);\r
 \r
+bool is_common_profile(void);\r
+\r
 #define MA_UG_NAME "setting-myaccount-efl"\r
 \r
 #define MA_IMAGE_EDJ_NAME "/usr/apps/setting-myaccount-efl/res/edje/setting-myaccount-efl/myaccount_edc_images.edj"\r
index 7c0c1f7..331b1c4 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       my-account-profile_mobile
 Summary:    My account application
-Version:    1.9.105
+Version:    1.9.106
 Release:    1
 Provides:   my-account = %{version}-%{release}
 Group:      main/devel
@@ -20,6 +20,7 @@ BuildRequires:  pkgconfig(accounts-svc)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:  pkgconfig(efl-extension)
+BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  cmake
 BuildRequires:  gettext-devel
 BuildRequires:  edje-bin
index 75a2c2e..8d77f82 100755 (executable)
@@ -664,7 +664,10 @@ static Evas_Object *__myaccount_account_list_create_genlist(
        int account_count = 0;
        account_count = __myaccount_account_list_populate_account_info(ad);
 
-       account_list_itc.item_style = "type1";
+       if (is_common_profile())
+               account_list_itc.item_style = "1line";
+       else
+               account_list_itc.item_style = "type1";
        account_list_itc.func.text_get = __myaccount_account_list_gl_label_get;
        account_list_itc.func.content_get = __myaccount_account_list_gl_icon_get;
        account_list_itc.func.state_get = NULL;
index c95b9ff..c458f9a 100755 (executable)
@@ -330,7 +330,10 @@ static Evas_Object * __myaccount_addaccount_create_genlist_layout(
 {
        Evas_Object *genlist;
 
-       addacc_list_itc.item_style = "type1";
+       if (is_common_profile())
+               addacc_list_itc.item_style = "1line";
+       else
+               addacc_list_itc.item_style = "type1";
        addacc_list_itc.func.text_get = __myaccount_addaccount_gl_label_get;
        addacc_list_itc.func.content_get = __myaccount_addaccount_icon_get;
        addacc_list_itc.func.state_get = NULL;
index bb5dc23..834abc9 100755 (executable)
@@ -17,7 +17,7 @@
  *\r
  */\r
 \r
-\r
+#include <system_info.h>\r
 #include "myaccount_ug.h"\r
 #include "myaccount_ug_common.h"\r
 #include "myaccount_ug_addaccount.h"\r
@@ -756,3 +756,21 @@ int myaccount_common_get_account_type_count(const char* capability_filter)
        return count;\r
 }\r
 \r
+bool is_common_profile(void)\r
+{\r
+       char *profile = NULL;\r
+\r
+       if (system_info_get_platform_string("http://tizen.org/feature/profile", &profile) < 0)\r
+               return false;\r
+\r
+       if (profile == NULL)\r
+               return false;\r
+\r
+       if (strncmp(profile, "common", strlen("common")) == 0) {\r
+               free(profile);\r
+               return true;\r
+       }\r
+\r
+       free(profile);\r
+       return false;\r
+}\r