Skip to content

Commit dbb49f9

Browse files
author
James Stapleton
committed
Merge branch 'release/2.0.8'
Fixed bug for some devices where 'afterTextChange' will be called, while already processing the event 'afterTextChange' which causes a stack overflow.
2 parents aba9bba + 10a42e4 commit dbb49f9

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

passwordmaker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ dependencies {
107107
compile fileTree(dir: 'libs', include: ['*.jar'])
108108
// You must install or update the Support Repository through the SDK manager to use this dependency.
109109
compile 'com.intellij:annotations:12.0@jar'
110-
compile 'org.passwordmaker:passwordmaker-je-lib:0.9.9'
110+
compile 'org.passwordmaker:passwordmaker-je-lib:0.9.10'
111111
compile 'com.madgag.spongycastle:core:1.50.0.0'
112112
compile 'com.madgag.spongycastle:prov:1.50.0.0'
113113
androidTestCompile 'junit:junit:4.8.1'

passwordmaker/src/main/java/org/passwordmaker/android/MainActivity.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,24 @@ public void onFocusChange(View v, boolean hasFocus) {
454454
}
455455
};
456456

457+
458+
boolean alreadyUpdatingPassword = false;
459+
460+
/**
461+
* Update password must only be called from the gui thread.
462+
* @param requireMinLength - the min length required before updating the output password.
463+
*/
457464
private void updatePassword(boolean requireMinLength) {
465+
if (alreadyUpdatingPassword) return;
466+
alreadyUpdatingPassword = true;
467+
try {
468+
updatePasswordOnce(requireMinLength);
469+
} finally {
470+
alreadyUpdatingPassword = false;
471+
}
472+
}
473+
474+
private void updatePasswordOnce(boolean requireMinLength) {
458475
final SecureUTF8String masterPassword = new SecureUTF8String(getInputPassword());
459476
final TextView outputPassword = (TextView) findViewById(R.id.txtPassword);
460477
if (!requireMinLength || masterPassword.length() >= MIN_PASSWORD_LEN_FOR_VERIFICATION_CODE ) {

0 commit comments

Comments
 (0)