Replace deprecated dpm handles with device_policy_manager_h 70/84770/1 accepted/tizen/common/20160824.154529 accepted/tizen/ivi/20160825.000602 accepted/tizen/mobile/20160825.000510 accepted/tizen/tv/20160825.000526 submit/tizen/20160824.043713
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 22 Aug 2016 09:01:28 +0000 (18:01 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 22 Aug 2016 09:01:40 +0000 (18:01 +0900)
Change-Id: I9b148a7670e0c0c35a647eb0e9e7c9088bb27c58
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/ug-setting-mobileap-efl.spec
src/mh_view_main.c

index 4ed6cfd..e2b1756 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:          ug-setting-mobileap-efl
 Summary:       Tethering UI Gadget Library
-Version:       1.0.146
+Version:       1.0.147
 Release:       1
 Group:         App/Network
 License:       Flora-1.1
index 1ed681f..b97aaf9 100755 (executable)
@@ -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;
 }