X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmh_view_main.c;h=b97aaf9aef3d0eee18eba7e1466198d6d70dbc9b;hb=ba3cd480c44b16834a398b8b0faf8e188606e175;hp=1ed681f2064ac6aa477780d9277fbdd2fb2ef466;hpb=f04ba6c0f0d6ce0cd5b73ba051fa90eb4af00396;p=apps%2Fnative%2Fug-mobile-ap.git diff --git a/src/mh_view_main.c b/src/mh_view_main.c index 1ed681f..b97aaf9 100755 --- a/src/mh_view_main.c +++ b/src/mh_view_main.c @@ -555,38 +555,29 @@ void _update_main_view(mh_appdata_t *ad, tethering_type_e type) static int __is_allowed(tethering_type_e type) { int state = 0; - dpm_context_h context = NULL; - dpm_restriction_policy_h policy = NULL; + device_policy_manager_h dpm = NULL; - context = dpm_context_create(); - if (context == NULL) { - ERR("Failed to create dpm context!!"); - return 0; - } - - policy = dpm_context_acquire_restriction_policy(context); - if (policy == NULL) { - ERR("Failed to create policy handle"); - dpm_context_destroy(context); + dpm = dpm_manager_create(); + if (dpm == NULL) { + ERR("Failed to create device policy manager!!"); return 0; } switch(type) { case TETHERING_TYPE_WIFI: - dpm_restriction_get_wifi_hotspot_state(policy, &state); + dpm_restriction_get_wifi_hotspot_state(dpm, &state); break; case TETHERING_TYPE_USB: - dpm_restriction_get_usb_tethering_state(policy, &state); + dpm_restriction_get_usb_tethering_state(dpm, &state); break; case TETHERING_TYPE_BT: - dpm_restriction_get_bluetooth_tethering_state(policy, &state); + dpm_restriction_get_bluetooth_tethering_state(dpm, &state); break; default: break; } - dpm_context_release_restriction_policy(context, policy); - dpm_context_destroy(context); + dpm_manager_destroy(dpm); return state; }