From cd0b23e0038d27bf38cde1a68f66996eb2d65a07 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Sat, 30 May 2020 21:08:38 +0200 Subject: Make commitChange honor finishWithResultOnEnd (#815) If PasswordRepository.isGitRepo() returns false, commitChange currently doesn't honor the finishWithResultOnEnd parameter, which causes Autofill generate flows to hang on a blank AutofillSaveActivity. This commit lets commitChange mimic what GitAsyncTask does with the parameter. Co-authored-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt index 45269145..8c5aa3ae 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt @@ -839,7 +839,13 @@ class PasswordStore : AppCompatActivity() { private const val PREFERENCE_SEEN_AUTOFILL_ONBOARDING = "seen_autofill_onboarding" fun commitChange(activity: Activity, message: String, finishWithResultOnEnd: Intent? = null) { - if (!PasswordRepository.isGitRepo()) return + if (!PasswordRepository.isGitRepo()) { + if (finishWithResultOnEnd != null) { + activity.setResult(Activity.RESULT_OK, finishWithResultOnEnd) + activity.finish() + } + return + } object : GitOperation(getRepositoryDirectory(activity), activity) { override fun execute() { tag(TAG).d { "Committing with message $message" } -- cgit v1.2.3