Apply DPM API changes 56/84756/1 accepted/tizen/common/20160825.062830 accepted/tizen/ivi/20160829.041707 accepted/tizen/mobile/20160829.041604 accepted/tizen/tv/20160829.041630 accepted/tizen/wearable/20160829.041645 submit/tizen/20160825.004351
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 22 Aug 2016 07:52:50 +0000 (16:52 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 22 Aug 2016 07:52:50 +0000 (16:52 +0900)
Change-Id: I42a1d1482ff95959a5c1a35a59ced4772504613d
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bt-main-ug.h
src/libraries/bt-util.c
src/ui/bt-main-view.c

index ec72f82..20a4232 100644 (file)
@@ -209,7 +209,6 @@ typedef struct {
        bt_confirm_req_t confirm_req;
 
        void *dpm_handle;
-       void *dpm_policy_handle;
        int dpm_callback_id;
 } bt_ug_data;
 
index 9e742b4..082d963 100644 (file)
@@ -692,22 +692,21 @@ int _bt_util_create_dpm_context(void *ug_data)
        FN_START;
 
        int ret;
-       dpm_context_h handle = NULL;
-       dpm_restriction_policy_h policy_handle = NULL;
+       device_policy_manager_h handle = NULL;
        bt_ug_data *ugd = NULL;
 
        retv_if(ug_data == NULL, BT_UG_FAIL);
 
        ugd = (bt_ug_data *)ug_data;
 
-       handle = dpm_context_create();
+       handle = dpm_manager_create();
 
        if (handle == NULL) {
                BT_ERR("Fail to create dpm context");
                return BT_UG_FAIL;
        }
 
-       ret = dpm_context_add_policy_changed_cb(handle, "bluetooth",
+       ret = dpm_add_policy_changed_cb(handle, "bluetooth",
                                                        __bt_util_dpm_policy_changed_cb,
                                                        (void *)ugd, &ugd->dpm_callback_id);
        if (ret != DPM_ERROR_NONE)
@@ -715,12 +714,6 @@ int _bt_util_create_dpm_context(void *ug_data)
 
        ugd->dpm_handle = (void *)handle;
 
-       policy_handle = dpm_context_acquire_restriction_policy(handle);
-       if (policy_handle == NULL)
-               BT_ERR("Fail to acquire restriction policy handle");
-
-       ugd->dpm_policy_handle = policy_handle;
-
        FN_END;
        return BT_UG_ERROR_NONE;
 }
@@ -736,20 +729,15 @@ void _bt_util_destroy_dpm_context(void *ug_data)
 
        ugd = (bt_ug_data *)ug_data;
 
-       ret = dpm_context_release_restriction_policy(ugd->dpm_handle, ugd->dpm_policy_handle);
-       if (ret != DPM_ERROR_NONE)
-               BT_ERR("Fail to release policy handle [%d]", ret);
-
        ret = dpm_context_remove_policy_changed_cb(ugd->dpm_handle, ugd->dpm_callback_id);
        if (ret != DPM_ERROR_NONE)
                BT_ERR("Fail to remove callback [%d]", ret);
 
-       ret = dpm_context_destroy(ugd->dpm_handle);
+       ret = dpm_manager_destroy(ugd->dpm_handle);
        if (ret != DPM_ERROR_NONE)
                BT_ERR("Fail to destroy dpm context [%d]", ret);
 
        ugd->dpm_handle = NULL;
-       ugd->dpm_policy_handle = NULL;
        ugd->dpm_callback_id = 0;
 
        FN_END;
@@ -764,7 +752,7 @@ gboolean _bt_util_is_dpm_restricted(void *handle)
 
        retv_if(handle == NULL, FALSE);
 
-       ret = dpm_restriction_get_bluetooth_mode_change_state((dpm_restriction_policy_h)handle,
+       ret = dpm_restriction_get_bluetooth_mode_change_state((device_policy_manager_h)handle,
                                                                                &dpm_state);
        if (ret != DPM_ERROR_NONE) {
                BT_ERR("Fail to destroy dpm context [%d]", ret);
index cc16df1..f6dd9f4 100644 (file)
@@ -153,7 +153,7 @@ static Evas_Object *__bt_main_onoff_icon_get(void *data, Evas_Object *obj,
                        ugd->onoff_btn = btn;
                }
 
-               if (_bt_util_is_dpm_restricted(ugd->dpm_policy_handle) == TRUE)
+               if (_bt_util_is_dpm_restricted(ugd->dpm_handle) == TRUE)
                        elm_object_disabled_set(btn, EINA_TRUE);
 
                evas_object_show(btn);
@@ -2394,7 +2394,7 @@ static Evas_Object *__bt_main_add_genlist_dialogue(Evas_Object *parent,
 
        ugd->onoff_item = git;
 
-       if (_bt_util_is_dpm_restricted(ugd->dpm_policy_handle) == TRUE)
+       if (_bt_util_is_dpm_restricted(ugd->dpm_handle) == TRUE)
                elm_object_item_disabled_set(ugd->onoff_item, EINA_TRUE);
 
        _bt_main_add_device_name_item(ugd, genlist);