Mark dpm_password_get_quality() call temporarily 76/102376/1
authorkiso.chang <kiso.chang@samsung.com>
Mon, 5 Dec 2016 12:20:53 +0000 (21:20 +0900)
committerkiso.chang <kiso.chang@samsung.com>
Mon, 5 Dec 2016 12:21:30 +0000 (21:21 +0900)
Change-Id: If8777b9a4d647085b81d964cd93e671bea213440
Signed-off-by: kiso.chang <kiso.chang@samsung.com>
setting-locktype/src/setting-locktype-main.c

index 938f89015409525fa1dd32ca853eac2bb3840f96..5183b013e44a3257e2bcebeb637a8066687dfde9 100755 (executable)
@@ -154,7 +154,7 @@ static int _pwd_handler_sec_pw_simple_passwd(SettingLocktype *data, void *arg)
  **
  ****************************************************/
 
-static int dpm_get_password_policy(dpm_password_quality_e *quality, int *minimum_length)
+static int dpm_get_password_policy(int *quality, int *minimum_length)
 {
        SETTING_TRACE_BEGIN;
        device_policy_manager_h handle;
@@ -165,8 +165,13 @@ static int dpm_get_password_policy(dpm_password_quality_e *quality, int *minimum
                SETTING_TRACE_ERROR("Failed to create client context");
                return 0;
        }
-
+#if 0
        ret = dpm_password_get_quality(handle, quality);
+#else
+       *quality = DPM_PASSWORD_QUALITY_UNSPECIFIED;
+       *minimum_length = 5;
+       ret = DPM_ERROR_NONE;
+#endif
        if (ret != DPM_ERROR_NONE) {
                SETTING_TRACE_ERROR("Failed to dpm_password_get_quality : %d",
                                ret);
@@ -526,26 +531,16 @@ void __add_locktype_items(void *data)
        else
                SETTING_TRACE_ERROR("item_data is NULL");
 
-       dpm_password_quality_e quality;
+       int quality;
        int minimum_length;
        dpm_get_password_policy(&quality, &minimum_length);
 
-#if 0
-typedef enum {
-       DPM_PASSWORD_QUALITY_UNSPECIFIED     = 0x00,    /**< No requirements for password. */
-       DPM_PASSWORD_QUALITY_SIMPLE_PASSWORD = 0x01,    /**< EAS(Exchange ActiveSync) requirement for simple password */
-       DPM_PASSWORD_QUALITY_SOMETHING       = 0x10,    /**< Some kind password is required, but doesn't care what it is */
-       DPM_PASSWORD_QUALITY_NUMERIC     = 0x20,    /**< Containing at least numeric characters */
-       DPM_PASSWORD_QUALITY_ALPHABETIC      = 0x40,    /**< Containing at least alphabetic (or other symbol) characters */
-       DPM_PASSWORD_QUALITY_ALPHANUMERIC    = 0x80,    /**< Containing at least numeric and alphabetic characters */
-} dpm_password_quality_e;
-#endif
 
-       if (quality == DPM_PASSWORD_QUALITY_UNSPECIFIED) {
+       if (quality & (int)DPM_PASSWORD_QUALITY_UNSPECIFIED) {
                /* no dim*/
-       } else if (quality == DPM_PASSWORD_QUALITY_SIMPLE_PASSWORD
-                       || quality == DPM_PASSWORD_QUALITY_SOMETHING
-                       || quality == DPM_PASSWORD_QUALITY_NUMERIC) {
+       } else if (quality & (int)DPM_PASSWORD_QUALITY_SIMPLE_PASSWORD
+                       || quality & (int)DPM_PASSWORD_QUALITY_SOMETHING
+                       || quality & (int)DPM_PASSWORD_QUALITY_NUMERIC) {
                // dim swipe, none
                if (ad->data_locktype_none)
                        setting_disable_genlist_item(
@@ -558,8 +553,8 @@ typedef enum {
                        if (ad->data_locktype_simple)
                                setting_disable_genlist_item(
                                                ad->data_locktype_simple->item);
-       } else if (quality == DPM_PASSWORD_QUALITY_ALPHABETIC
-                       || quality == DPM_PASSWORD_QUALITY_ALPHANUMERIC) {
+       } else if (quality & (int)DPM_PASSWORD_QUALITY_ALPHABETIC
+                       || quality & (int)DPM_PASSWORD_QUALITY_ALPHANUMERIC) {
                // dim swipe, none, simple password
                if (ad->data_locktype_none)
                        setting_disable_genlist_item(