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)
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;
}
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;
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);
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);
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);