Revision 72d577fb app/src/info/guardianproject/notepadbot/LockScreenActivity.java
app/src/info/guardianproject/notepadbot/LockScreenActivity.java | ||
---|---|---|
31 | 31 |
public class LockScreenActivity extends SherlockActivity implements ICacheWordSubscriber { |
32 | 32 |
private static final String TAG = "LockScreenActivity"; |
33 | 33 |
|
34 |
private final static int MIN_PASS_LENGTH = 8; |
|
35 |
// private final static int MAX_PASS_ATTEMPTS = 3; |
|
36 |
// private final static int PASS_RETRY_WAIT_TIMEOUT = 30000; |
|
37 |
|
|
38 | 34 |
private EditText mEnterPassphrase; |
39 | 35 |
private EditText mNewPassphrase; |
40 | 36 |
private EditText mConfirmNewPassphrase; |
... | ... | |
119 | 115 |
} |
120 | 116 |
|
121 | 117 |
private boolean isPasswordValid() { |
122 |
return validatePassword(mNewPassphrase.getText().toString().toCharArray()); |
|
118 |
boolean valid = NConstants.validatePassword(mNewPassphrase.getText().toString().toCharArray()); |
|
119 |
if(!valid) |
|
120 |
mPasswordError = getString(R.string.pass_err_length); |
|
121 |
return valid; |
|
123 | 122 |
} |
124 | 123 |
|
125 | 124 |
private boolean isConfirmationFieldEmpty() { |
... | ... | |
233 | 232 |
}); |
234 | 233 |
} |
235 | 234 |
|
236 |
private boolean validatePassword(char[] pass) |
|
237 |
{ |
|
238 |
if (pass.length < MIN_PASS_LENGTH) { |
|
239 |
// should we support some user string message here? |
|
240 |
mPasswordError = getString(R.string.pass_err_length); |
|
241 |
return false; |
|
242 |
} |
|
243 |
return true; |
|
244 |
} |
|
245 |
|
|
246 | 235 |
public class TwoViewSlider { |
247 | 236 |
|
248 | 237 |
private boolean firstIsShown = true; |
Also available in: Unified diff