From: Stephen Bird Date: Thu, 9 Jul 2015 23:28:20 +0000 (-0700) Subject: Secure Storage: Fix unlock button X-Git-Tag: android-x86-6.0-r1~76 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fpackages-apps-CMFileManager.git;a=commitdiff_plain;h=c2832885bd00d45ac7277930cff68063e1cb4d3a Secure Storage: Fix unlock button Change-Id: I852fff76aef4f47bbd6d809c64afcc2f77165553 --- diff --git a/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyPromptDialog.java b/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyPromptDialog.java index 73bb3ad..f2045f8 100755 --- a/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyPromptDialog.java +++ b/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyPromptDialog.java @@ -245,19 +245,19 @@ public class SecureStorageKeyPromptDialog boolean validLength = key.length() >= MIN_PASSWORD_LENGTH && (!mResetPassword || (mResetPassword && oldkey.length() >= MIN_PASSWORD_LENGTH)); boolean validEquals = key.equals(repeatKey); - boolean valid = validLength && - (((mNewStorage || mResetPassword) && validEquals) || mDeleteStorage); - mUnlock.setEnabled(valid); if (!validLength) { mValidationMsg.setText(getString(R.string.secure_storage_unlock_validation_length, MIN_PASSWORD_LENGTH)); mValidationMsg.setVisibility(View.VISIBLE); + mUnlock.setEnabled(false); } else if ((mNewStorage || mResetPassword) && !validEquals) { mValidationMsg.setText(R.string.secure_storage_unlock_validation_equals); mValidationMsg.setVisibility(View.VISIBLE); + mUnlock.setEnabled(false); } else { mValidationMsg.setVisibility(View.INVISIBLE); + mUnlock.setEnabled(true); } }