Change indentation: spaces to tabs 13/78813/2
authorJaemin Ryu <jm77.ryu@samsung.com>
Thu, 7 Jul 2016 02:44:18 +0000 (11:44 +0900)
committerJaemin Ryu <jm77.ryu@samsung.com>
Thu, 7 Jul 2016 03:51:54 +0000 (12:51 +0900)
Change-Id: I77ea9d50f61a157e76447201a377708ea988cb7f
Signed-off-by: Jaemin Ryu <jm77.ryu@samsung.com>
16 files changed:
CMakeLists.txt
LICENSE
edc_resource/genlist_custom.edc
include/dpm-toolkit.h
org.tizen.dpm-toolkit.xml
res/org.tizen.dpm-toolkit.edc
src/application.c
src/bluetooth.c
src/dpm-toolkit-cli.c
src/dpm-toolkit-gui.c
src/dpm-toolkit.c
src/password.c
src/restriction.c
src/security.c
src/wifi.c
src/zone.c

index 121d3ab..dfacf1e 100755 (executable)
@@ -22,7 +22,7 @@ SET(VERSION "${VERSION_MAJOR}.1.0")
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 IF(NOT CMAKE_BUILD_TYPE)
-    SET(CMAKE_BUILD_TYPE "DEBUG")
+       SET(CMAKE_BUILD_TYPE "DEBUG")
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
 ADD_DEFINITIONS("-DUG_WAYLAND")
diff --git a/LICENSE b/LICENSE
index 26b7de6..25a286e 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -2,7 +2,7 @@ Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
 
                                  Apache License
                            Version 2.0, January 2004
-                        http://www.apache.org/licenses/
+                      http://www.apache.org/licenses/
 
    TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
 
@@ -194,7 +194,7 @@ Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
 
-       http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
index 769ea8a..524df0f 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ *  Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
 group { name: "gl_custom_item";
        styles{
                style { name: "text_style";
index a606304..2340221 100755 (executable)
@@ -96,7 +96,7 @@ static inline const char* policy_get_title(xtk_policy_t* entity)
 
 static inline const char* policy_get_default_value(xtk_policy_t* entity)
 {
-       return entity->param;
+        return entity->param;
 }
 
 xtk_context_t* xtk_context_get_current(void);
index 1f9d137..17d372d 100755 (executable)
@@ -1,29 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.dpm-toolkit" api-version="3.0" version="1.0.0" install-location="internal-only">
-    <label>dpm-toolkit</label>
-    <profile name="mobile"/>
-    <description>Tizen DPM test application</description>
-    <ui-application appid="org.tizen.dpm-toolkit" exec="/usr/apps/org.tizen.dpm-toolkit/bin/org.tizen.dpm-toolkit" nodisplay="false" multiple="false" type="capp" taskmanage="true">
-        <label>dpm-toolkit</label>
-        <icon>org.tizen.dpm-toolkit.png</icon>
-    </ui-application>
-    <privileges>
-        <privilege>http://tizen.org/privilege/dpm.password</privilege>
-        <privilege>http://tizen.org/privilege/dpm.camera</privilege>
-        <privilege>http://tizen.org/privilege/dpm.microphone</privilege>
-        <privilege>http://tizen.org/privilege/dpm.location</privilege>
-        <privilege>http://tizen.org/privilege/dpm.storage</privilege>
-        <privilege>http://tizen.org/privilege/dpm.clipboard</privilege>
-        <privilege>http://tizen.org/privilege/dpm.debugging</privilege>
-        <privilege>http://tizen.org/privilege/dpm.wifi</privilege>
-        <privilege>http://tizen.org/privilege/dpm.bluetooth</privilege>
-        <privilege>http://tizen.org/privilege/dpm.usb</privilege>
-        <privilege>http://tizen.org/privilege/dpm.message</privilege>
-        <privilege>http://tizen.org/privilege/dpm.email</privilege>
-        <privilege>http://tizen.org/privilege/dpm.browser</privilege>
-        <privilege>http://tizen.org/privilege/dpm.zone</privilege>
-        <privilege>http://tizen.org/privilege/dpm.lock</privilege>
-        <privilege>http://tizen.org/privilege/dpm.security</privilege>
-        <privilege>http://tizen.org/privilege/dpm.wipe</privilege>
-    </privileges>
+       <label>dpm-toolkit</label>
+       <profile name="mobile"/>
+       <description>Tizen DPM test application</description>
+       <ui-application appid="org.tizen.dpm-toolkit" exec="/usr/apps/org.tizen.dpm-toolkit/bin/org.tizen.dpm-toolkit" nodisplay="false" multiple="false" type="capp" taskmanage="true">
+               <label>dpm-toolkit</label>
+               <icon>org.tizen.dpm-toolkit.png</icon>
+       </ui-application>
+       <privileges>
+               <privilege>http://tizen.org/privilege/dpm.password</privilege>
+               <privilege>http://tizen.org/privilege/dpm.camera</privilege>
+               <privilege>http://tizen.org/privilege/dpm.microphone</privilege>
+               <privilege>http://tizen.org/privilege/dpm.location</privilege>
+               <privilege>http://tizen.org/privilege/dpm.storage</privilege>
+               <privilege>http://tizen.org/privilege/dpm.clipboard</privilege>
+               <privilege>http://tizen.org/privilege/dpm.debugging</privilege>
+               <privilege>http://tizen.org/privilege/dpm.wifi</privilege>
+               <privilege>http://tizen.org/privilege/dpm.bluetooth</privilege>
+               <privilege>http://tizen.org/privilege/dpm.usb</privilege>
+               <privilege>http://tizen.org/privilege/dpm.message</privilege>
+               <privilege>http://tizen.org/privilege/dpm.email</privilege>
+               <privilege>http://tizen.org/privilege/dpm.browser</privilege>
+               <privilege>http://tizen.org/privilege/dpm.zone</privilege>
+               <privilege>http://tizen.org/privilege/dpm.lock</privilege>
+               <privilege>http://tizen.org/privilege/dpm.security</privilege>
+               <privilege>http://tizen.org/privilege/dpm.wipe</privilege>
+       </privileges>
 </manifest>
index 9e2de6a..847003e 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ *  Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
 collections {
        base_scale: 2.6;
        #include "../edc_resource/genlist_custom.edc"
index 1f165b1..a422b17 100755 (executable)
  *  limitations under the License
  */
 
-#include "dpm-toolkit.h"
-
 #include <dpm/application.h>
 
+#include "dpm-toolkit.h"
+
 int install_package_handler(struct xtk_policy* self)
 {
        char* pkgpath;
@@ -59,7 +59,7 @@ int uninstall_package_handler(struct xtk_policy* self)
                return POLICY_RESULT_FAIL;
        }
 
-       if (xtk_open_entry_popup(self, "org.tizen.sampleapp",
+       if (xtk_open_entry_popup(self, "sampleapp",
                                                                   "Enter package id",
                                                                   &pkgid) == XTK_EVENT_CANCEL) {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Entry get canceled");
@@ -100,8 +100,8 @@ int set_mode_restriction_handler(struct xtk_policy* self)
        }
 
        switch (index) {
-       case 0 : index = DPM_PACKAGE_RESTRICTION_MODE_INSTALL; break;
-       case 1 : index = DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL; break;
+       case 0: index = DPM_PACKAGE_RESTRICTION_MODE_INSTALL; break;
+       case 1: index = DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL; break;
        }
 
        if (dpm_application_set_mode_restriction(handle, index) != DPM_ERROR_NONE) {
@@ -159,8 +159,8 @@ int unset_mode_restriction_handler(struct xtk_policy* self)
        }
 
        switch (index) {
-       case 0 : index = DPM_PACKAGE_RESTRICTION_MODE_INSTALL; break;
-       case 1 : index = DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL; break;
+       case 0: index = DPM_PACKAGE_RESTRICTION_MODE_INSTALL; break;
+       case 1: index = DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL; break;
        }
 
        if (dpm_application_unset_mode_restriction(handle, index) != DPM_ERROR_NONE) {
@@ -183,10 +183,10 @@ int unset_mode_restriction_handler(struct xtk_policy* self)
 
        switch (index) {
        case DPM_PACKAGE_RESTRICTION_MODE_INSTALL:
-               msg = "All package installation is disabled";
+               msg = "All package installation is enabled";
                break;
        case DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL:
-               msg = "All package uninstallation is disabled";
+               msg = "All package uninstallation is enabled";
                break;
        }
 
@@ -217,7 +217,7 @@ int get_mode_restriction_handler(struct xtk_policy* self)
        dpm_manager_destroy(handle);
        snprintf(msg, 128, "Package installation is %s, Package uninstallation is %s",
                        (state & DPM_PACKAGE_RESTRICTION_MODE_INSTALL) ? "DISABLED" : "ENABLED",
-                       (state & DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL) ? "DISABLED" : "ENABLED");
+                        (state & DPM_PACKAGE_RESTRICTION_MODE_UNINSTALL) ? "DISABLED" : "ENABLED");
 
        xtk_open_message_popup(self, msg);
 
@@ -260,7 +260,7 @@ int add_privilege_to_blacklist_handler(struct xtk_policy* self)
                return POLICY_RESULT_FAIL;
        }
 
-    if (dpm_application_check_privilege_is_blacklisted(handle, index, privilege, &state) != DPM_ERROR_NONE) {
+       if (dpm_application_check_privilege_is_blacklisted(handle, index, privilege, &state) != DPM_ERROR_NONE) {
                free(privilege);
                dpm_manager_destroy(handle);
                xtk_open_message_popup(self, "Failed to query privilege blacklist");
index 8d1d69e..f0f6d3e 100644 (file)
 
 #include <stdbool.h>
 
-#include "dpm-toolkit.h"
 #include <dpm/bluetooth.h>
 
+#include "dpm-toolkit.h"
+
 int set_device_restriction_handler(struct xtk_policy *self)
 {
        int state;
index d4994e6..621bfee 100755 (executable)
@@ -54,7 +54,7 @@ inline void section_separator(void)
 
 inline void group_separator(void)
 {
-    fancy_text(DEFAULT, NONE, "--------------------------------------------------\n");
+       fancy_text(DEFAULT, NONE, "--------------------------------------------------\n");
 }
 
 inline void text_header(const char* title, const char* msg)
@@ -74,7 +74,7 @@ static int open_entry_popup(const char* title, const char* msg, const char* guid
        text_header(title, msg);
        section_separator();
        fancy_text(DEFAULT, NONE, "Enter text(type '.' to cancel) : ");
-        *value = malloc(64);
+               *value = malloc(64);
        scanf("%64s", *value);
        if (*value[0] == '.') {
                return XTK_EVENT_CANCEL;
index ba8d4d1..47cfe96 100755 (executable)
@@ -293,7 +293,7 @@ static void _gl_policy_group_select(void* data, Evas_Object* obj, void* event_in
                xtk_policy_t* entity = glist_to_policy(policy_list);
 
                elm_genlist_item_append(genlist, itc, (void *)entity, NULL, ELM_GENLIST_ITEM_NONE,
-                                                           _gl_policy_select, (void *)entity);
+                                                               _gl_policy_select, (void *)entity);
        }
        elm_genlist_item_class_free(itc);
 
index f436d51..6e64827 100755 (executable)
@@ -151,28 +151,28 @@ int xtk_init_policy(xtk_policy_group_t* group, xtk_policy_t* policy, int nr)
 
 char* get_now_zone(void)
 {
-    struct passwd pwd, *result;
-    int bufsize;
+       struct passwd pwd, *result;
+       int bufsize;
 
-    bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
-    if (bufsize == -1) {
-        bufsize = 16384;
+       bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+       if (bufsize == -1) {
+               bufsize = 16384;
        }
 
-    char *buf = malloc(bufsize * sizeof(char));
+       char *buf = malloc(bufsize * sizeof(char));
        if (buf == NULL) {
                return NULL;
        }
 
-    getpwuid_r(getuid(), &pwd, buf, bufsize, &result);
-    if (result == NULL) {
-        free(buf);
-        return NULL;
-    }
+       getpwuid_r(getuid(), &pwd, buf, bufsize, &result);
+       if (result == NULL) {
+               free(buf);
+               return NULL;
+       }
 
-    free(buf);
+       free(buf);
 
-    return strdup(result->pw_name);
+       return strdup(result->pw_name);
 }
 
 void xtk_free_policy_list(void)
index 10530a8..bd6126c 100755 (executable)
  *  limitations under the License
  */
 
-#include "dpm-toolkit.h"
-
 #include <dpm/password.h>
 
+#include "dpm-toolkit.h"
+
 int set_password_quality_handler(struct xtk_policy *self)
 {
        int index;
index 5f3fe91..458a8e0 100644 (file)
  *  limitations under the License
  */
 
-#include "dpm-toolkit.h"
-
 #include <dpm/restriction.h>
 
+#include "dpm-toolkit.h"
+
 int set_camera_state_handler(struct xtk_policy *self)
 {
        int state, allow;
@@ -590,27 +590,27 @@ int set_external_storage_state_handler(struct xtk_policy *self)
 
 int get_external_storage_state_handler(struct xtk_policy *self)
 {
-    int state;
-    device_policy_manager_h handle = NULL;
+       int state;
+       device_policy_manager_h handle = NULL;
 
-    handle = dpm_manager_create();
-    if (handle == NULL) {
+       handle = dpm_manager_create();
+       if (handle == NULL) {
                xtk_open_message_popup(self, "Failed to create device handle manager");
-        return POLICY_RESULT_FAIL;
-    }
+               return POLICY_RESULT_FAIL;
+       }
 
-    if (dpm_restriction_get_external_storage_state(handle, &state) != DPM_ERROR_NONE) {
-        dpm_manager_destroy(handle);
+       if (dpm_restriction_get_external_storage_state(handle, &state) != DPM_ERROR_NONE) {
+               dpm_manager_destroy(handle);
                xtk_open_message_popup(self, "Failed to query handle");
-        return POLICY_RESULT_NONE;
-    }
+               return POLICY_RESULT_NONE;
+       }
 
        xtk_open_message_popup(self, state ? "External Storage Allowed"
                                                                           : "External Storage Disallowed");
 
-    dpm_manager_destroy(handle);
+       dpm_manager_destroy(handle);
 
-    return POLICY_RESULT_FAIL;
+       return POLICY_RESULT_FAIL;
 }
 
 int set_bluetooth_mode_change_state_handler(struct xtk_policy *self)
@@ -1034,14 +1034,14 @@ xtk_policy_t xtk_restriction_policy[] = {
                .id = "GET_USB_TETHERING_STATE",
                .handler = get_usb_tethering_state_handler
        },
-    {
-        .id = "SET_EXTERNAL_STORAGE_STATE",
-        .handler = set_external_storage_state_handler
-    },
-    {
-        .id = "GET_EXTERNAL_STORAGE_STATE",
-        .handler = get_external_storage_state_handler
-    },
+       {
+               .id = "SET_EXTERNAL_STORAGE_STATE",
+               .handler = set_external_storage_state_handler
+       },
+       {
+               .id = "GET_EXTERNAL_STORAGE_STATE",
+               .handler = get_external_storage_state_handler
+       },
        {
                .id = "SET_BLUETOOTH_MODE_CHANGE_STATE",
                .handler = set_bluetooth_mode_change_state_handler
index 87da653..8a4d2c9 100755 (executable)
@@ -22,7 +22,7 @@ int lock_now_handler(struct xtk_policy* self)
 {
        device_policy_manager_h handle;
 
-       if (xtk_open_confirm_popup(self,"This operation will lockout the screen") == XTK_EVENT_CANCEL) {
+       if (xtk_open_confirm_popup(self, "This operation will lockout the screen") == XTK_EVENT_CANCEL) {
                return POLICY_RESULT_FAIL;
        };
 
@@ -45,129 +45,129 @@ int lock_now_handler(struct xtk_policy* self)
 
 int encrypt_device_handler(struct xtk_policy* self)
 {
-    int index;
-    device_policy_manager_h handle;
-    const char *text[] = {
-        "Encrypt Internal Storage",
-        "Encrypt External Storage"
-    };
-
-    if (xtk_open_radio_popup(self, text, ARRAY_SIZE(text), &index) == XTK_EVENT_CANCEL) {
-        dlog_print(DLOG_DEBUG, LOG_TAG, "Selection canceled");
-        return POLICY_RESULT_NONE;
-    }
-
-    handle = dpm_manager_create();
-    if (handle == NULL) {
-        xtk_open_message_popup(self, "Failed to create device policy manager");
-        return POLICY_RESULT_FAIL;
-    }
-
-    if (index == 0) {
-        if (dpm_security_set_internal_storage_encryption(handle, TRUE) != DPM_ERROR_NONE) {
-            dpm_manager_destroy(handle);
-            xtk_open_message_popup(self, "Failed to enforce policy");
-            return POLICY_RESULT_FAIL;
-        }
-    } else if (index == 1) {
-        if (dpm_security_set_external_storage_encryption(handle, TRUE) != DPM_ERROR_NONE) {
-            dpm_manager_destroy(handle);
-            xtk_open_message_popup(self, "Failed to enforce policy");
-            return POLICY_RESULT_FAIL;
-        }
-    }
-
-    dpm_manager_destroy(handle);
-
-    xtk_open_message_popup(self, "Operation successfully triggerred, "
-                                 "but product must provide encryption backend");
-
-    return POLICY_RESULT_SUCCESS;
+       int index;
+       device_policy_manager_h handle;
+       const char *text[] = {
+               "Encrypt Internal Storage",
+               "Encrypt External Storage"
+       };
+
+       if (xtk_open_radio_popup(self, text, ARRAY_SIZE(text), &index) == XTK_EVENT_CANCEL) {
+               dlog_print(DLOG_DEBUG, LOG_TAG, "Selection canceled");
+               return POLICY_RESULT_NONE;
+       }
+
+       handle = dpm_manager_create();
+       if (handle == NULL) {
+               xtk_open_message_popup(self, "Failed to create device policy manager");
+               return POLICY_RESULT_FAIL;
+       }
+
+       if (index == 0) {
+               if (dpm_security_set_internal_storage_encryption(handle, TRUE) != DPM_ERROR_NONE) {
+                       dpm_manager_destroy(handle);
+                       xtk_open_message_popup(self, "Failed to enforce policy");
+                       return POLICY_RESULT_FAIL;
+               }
+       } else if (index == 1) {
+               if (dpm_security_set_external_storage_encryption(handle, TRUE) != DPM_ERROR_NONE) {
+                       dpm_manager_destroy(handle);
+                       xtk_open_message_popup(self, "Failed to enforce policy");
+                       return POLICY_RESULT_FAIL;
+               }
+       }
+
+       dpm_manager_destroy(handle);
+
+       xtk_open_message_popup(self, "Operation successfully triggerred, "
+                                                                "but product must provide encryption backend");
+
+       return POLICY_RESULT_SUCCESS;
 }
 
 int decrypt_device_handler(struct xtk_policy* self)
 {
-    int index;
-    device_policy_manager_h handle;
-    const char *text[] = {
-        "Decrypt Internal Storage",
-        "Decrypt External Storage"
-    };
-
-    if (xtk_open_radio_popup(self, text, ARRAY_SIZE(text), &index) == XTK_EVENT_CANCEL) {
-        dlog_print(DLOG_DEBUG, LOG_TAG, "Selection canceled");
-        return POLICY_RESULT_NONE;
-    }
-
-    handle = dpm_manager_create();
-    if (handle == NULL) {
-        xtk_open_message_popup(self, "Failed to create device policy manager");
-        return POLICY_RESULT_FAIL;
-    }
-
-    if (index == 0) {
-        if (dpm_security_set_internal_storage_encryption(handle, FALSE) != DPM_ERROR_NONE) {
-            dpm_manager_destroy(handle);
-            xtk_open_message_popup(self, "Failed to enforce policy");
-            return POLICY_RESULT_FAIL;
-        }
-    } else if (index == 1) {
-        if (dpm_security_set_external_storage_encryption(handle, FALSE) != DPM_ERROR_NONE) {
-            dpm_manager_destroy(handle);
-            xtk_open_message_popup(self, "Failed to enforce policy");
-            return POLICY_RESULT_FAIL;
-        }
-    }
-
-    dpm_manager_destroy(handle);
-
-    xtk_open_message_popup(self, "Operation successfully triggerred, "
-                                 "but product must provide decryption backend");
-
-    return POLICY_RESULT_SUCCESS;
+       int index;
+       device_policy_manager_h handle;
+       const char *text[] = {
+               "Decrypt Internal Storage",
+               "Decrypt External Storage"
+       };
+
+       if (xtk_open_radio_popup(self, text, ARRAY_SIZE(text), &index) == XTK_EVENT_CANCEL) {
+               dlog_print(DLOG_DEBUG, LOG_TAG, "Selection canceled");
+               return POLICY_RESULT_NONE;
+       }
+
+       handle = dpm_manager_create();
+       if (handle == NULL) {
+               xtk_open_message_popup(self, "Failed to create device policy manager");
+               return POLICY_RESULT_FAIL;
+       }
+
+       if (index == 0) {
+               if (dpm_security_set_internal_storage_encryption(handle, FALSE) != DPM_ERROR_NONE) {
+                       dpm_manager_destroy(handle);
+                       xtk_open_message_popup(self, "Failed to enforce policy");
+                       return POLICY_RESULT_FAIL;
+               }
+       } else if (index == 1) {
+               if (dpm_security_set_external_storage_encryption(handle, FALSE) != DPM_ERROR_NONE) {
+                       dpm_manager_destroy(handle);
+                       xtk_open_message_popup(self, "Failed to enforce policy");
+                       return POLICY_RESULT_FAIL;
+               }
+       }
+
+       dpm_manager_destroy(handle);
+
+       xtk_open_message_popup(self, "Operation successfully triggerred, "
+                                                                "but product must provide decryption backend");
+
+       return POLICY_RESULT_SUCCESS;
 
 }
 
 int wipe_data_handler(struct xtk_policy* self)
 {
-    int index;
-    device_policy_manager_h handle;
-    const char *text[] = {
-        "Wipe Internal Storage",
-        "Wipe External Storage"
-    };
-
-    if (xtk_open_radio_popup(self, text, ARRAY_SIZE(text), &index) == XTK_EVENT_CANCEL) {
-        dlog_print(DLOG_DEBUG, LOG_TAG, "Selection canceled");
-        return POLICY_RESULT_NONE;
-    }
-
-    handle = dpm_manager_create();
-    if (handle == NULL) {
-        xtk_open_message_popup(self, "Failed to create device policy manager");
-        return POLICY_RESULT_FAIL;
-    }
-
-    if (index == 0) {
-        if (dpm_security_wipe_data(handle, DPM_SECURITY_WIPE_INTERNAL_STORAGE) != DPM_ERROR_NONE) {
-            dpm_manager_destroy(handle);
-            xtk_open_message_popup(self, "Failed to enforce policy");
-            return POLICY_RESULT_FAIL;
-        }
-    } else if (index == 1) {
-        if (dpm_security_wipe_data(handle, DPM_SECURITY_WIPE_EXTERNAL_STORAGE) != DPM_ERROR_NONE) {
-            dpm_manager_destroy(handle);
-            xtk_open_message_popup(self, "Failed to enforce policy");
-            return POLICY_RESULT_FAIL;
-        }
-    }
-
-    dpm_manager_destroy(handle);
-
-    xtk_open_message_popup(self, "Operation successfully triggerred "
-                                 "but it may take a long time to complete");
-
-    return POLICY_RESULT_SUCCESS;
+       int index;
+       device_policy_manager_h handle;
+       const char *text[] = {
+               "Wipe Internal Storage",
+               "Wipe External Storage"
+       };
+
+       if (xtk_open_radio_popup(self, text, ARRAY_SIZE(text), &index) == XTK_EVENT_CANCEL) {
+               dlog_print(DLOG_DEBUG, LOG_TAG, "Selection canceled");
+               return POLICY_RESULT_NONE;
+       }
+
+       handle = dpm_manager_create();
+       if (handle == NULL) {
+               xtk_open_message_popup(self, "Failed to create device policy manager");
+               return POLICY_RESULT_FAIL;
+       }
+
+       if (index == 0) {
+               if (dpm_security_wipe_data(handle, DPM_SECURITY_WIPE_INTERNAL_STORAGE) != DPM_ERROR_NONE) {
+                       dpm_manager_destroy(handle);
+                       xtk_open_message_popup(self, "Failed to enforce policy");
+                       return POLICY_RESULT_FAIL;
+               }
+       } else if (index == 1) {
+               if (dpm_security_wipe_data(handle, DPM_SECURITY_WIPE_EXTERNAL_STORAGE) != DPM_ERROR_NONE) {
+                       dpm_manager_destroy(handle);
+                       xtk_open_message_popup(self, "Failed to enforce policy");
+                       return POLICY_RESULT_FAIL;
+               }
+       }
+
+       dpm_manager_destroy(handle);
+
+       xtk_open_message_popup(self, "Operation successfully triggerred "
+                                                                "but it may take a long time to complete");
+
+       return POLICY_RESULT_SUCCESS;
 }
 
 xtk_policy_t xtk_security_policy[] = {
index f4ff614..019386e 100755 (executable)
  *  limitations under the License
  */
 
-#include "dpm-toolkit.h"
 #include <dpm/wifi.h>
 
+#include "dpm-toolkit.h"
+
 int wifi_set_profile_change_state_handler(struct xtk_policy* self)
 {
        int state, allow;
index f84b2cc..74b55ba 100755 (executable)
  *  limitations under the License
  */
 
-#include "dpm-toolkit.h"
 #include <dpm/zone.h>
 
+#include "dpm-toolkit.h"
+
 int create_zone_handler(struct xtk_policy* self)
 {
        device_policy_manager_h handle;
@@ -102,11 +103,11 @@ int get_zone_state_handler(struct xtk_policy* self)
 
        switch (ret) {
        case DPM_ERROR_NONE:
-                if (state & DPM_ZONE_STATE_RUNNING) {
-                    zone_state = "Running";
-                } else if (state & DPM_ZONE_STATE_LOCKED) {
-                    zone_state = "Locked";
-                }
+                               if (state & DPM_ZONE_STATE_RUNNING) {
+                                       zone_state = "Running";
+                               } else if (state & DPM_ZONE_STATE_LOCKED) {
+                                       zone_state = "Locked";
+                               }
 
                xtk_open_message_popup(self, zone_state);
                return POLICY_RESULT_NONE;
@@ -115,16 +116,16 @@ int get_zone_state_handler(struct xtk_policy* self)
                return POLICY_RESULT_NONE;
        }
 
-        xtk_open_message_popup(self, "Failed to get zone state");
+               xtk_open_message_popup(self, "Failed to get zone state");
        return POLICY_RESULT_NONE;
 }
 
 static bool zone_list_cb(const char* name, void* user_data)
 {
-    struct xtk_policy* self = (struct xtk_policy*)user_data;
-    xtk_open_message_popup(self, name);
+       struct xtk_policy* self = (struct xtk_policy*)user_data;
+       xtk_open_message_popup(self, name);
 
-    return true;
+       return true;
 }
 
 int get_zone_list_handler(struct xtk_policy* self)
@@ -141,9 +142,9 @@ int get_zone_list_handler(struct xtk_policy* self)
        dpm_manager_destroy(handle);
 
        if (ret != DPM_ERROR_NONE) {
-            xtk_open_message_popup(self, "Failed to get zone state");
-            return POLICY_RESULT_FAIL;
-        }
+                       xtk_open_message_popup(self, "Failed to get zone state");
+                       return POLICY_RESULT_FAIL;
+               }
        return POLICY_RESULT_NONE;
 }