Add white operation feature 02/182102/2
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 20 Jun 2018 08:55:59 +0000 (17:55 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 20 Jun 2018 09:01:24 +0000 (18:01 +0900)
If the value of app-control operation is special,
the callee application can be leader application of the app group.

Change-Id: Icd87e3c9f0a81f781d7aa85d63886e159ffb9734
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/service.c

index 316d758..6f67566 100755 (executable)
@@ -103,6 +103,27 @@ static bool __is_special_app(const char *appid)
        return false;
 }
 
+static bool __is_special_operation(bundle *b)
+{
+       const char *operation;
+       const char *white_operations[] = {
+               "http://tizen.org/appcontrol/operation/guide_privacy_setting",
+               NULL
+       };
+       int i;
+
+       operation = aul_svc_get_operation(b);
+       if (!operation)
+               return false;
+
+       for (i = 0; white_operations[i]; ++i) {
+               if (!strcmp(operation, white_operations[i]))
+                       return true;
+       }
+
+       return false;
+}
+
 static aul_svc_cb_info_t *__create_rescb(int request_code,
                                        aul_svc_res_fn cbfunc, void *data)
 {
@@ -209,7 +230,7 @@ static int __run_svc_with_pkgname(char *pkgname, bundle *b, int request_code,
        if (bundle_get_val(b, AUL_K_FORCE_LAUNCH_APP_SELECTOR))
                pkgname = APP_SELECTOR;
 
-       if (__is_special_app(pkgname)) {
+       if (__is_special_app(pkgname) || __is_special_operation(b)) {
                bundle_del(b, AUL_SVC_K_CAN_BE_LEADER);
                bundle_add_str(b, AUL_SVC_K_CAN_BE_LEADER, "true");
                bundle_del(b, AUL_SVC_K_REROUTE);