aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/autofill
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-09-03 10:48:14 +0200
committerGitHub <noreply@github.com>2020-09-03 14:18:14 +0530
commit3840f43fa0026b06b15913379761c1bf6b6a1c68 (patch)
tree41a5d47c3ed3ef06430d2d045876301d4db416ad /app/src/main/java/com/zeapo/pwdstore/autofill
parent258ccc601605f3112d9310043b9a34bf6ca3c9e0 (diff)
downloadHardenedPass-3840f43fa0026b06b15913379761c1bf6b6a1c68.tar.gz
HardenedPass-3840f43fa0026b06b15913379761c1bf6b6a1c68.zip
Refactor Git operations and auth (#1066)
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSaveActivity.kt16
1 files changed, 2 insertions, 14 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSaveActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSaveActivity.kt
index f6ef8757..0052ff65 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSaveActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSaveActivity.kt
@@ -15,9 +15,7 @@ import androidx.activity.result.contract.ActivityResultContracts.StartActivityFo
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
-import androidx.lifecycle.lifecycleScope
import com.github.ajalt.timberkt.e
-import com.zeapo.pwdstore.R
import com.zeapo.pwdstore.autofill.oreo.AutofillAction
import com.zeapo.pwdstore.autofill.oreo.AutofillMatcher
import com.zeapo.pwdstore.autofill.oreo.AutofillPreferences
@@ -26,9 +24,7 @@ import com.zeapo.pwdstore.autofill.oreo.FillableForm
import com.zeapo.pwdstore.autofill.oreo.FormOrigin
import com.zeapo.pwdstore.crypto.PasswordCreationActivity
import com.zeapo.pwdstore.utils.PasswordRepository
-import com.zeapo.pwdstore.utils.commitChange
import java.io.File
-import kotlinx.coroutines.launch
@RequiresApi(Build.VERSION_CODES.O)
class AutofillSaveActivity : AppCompatActivity() {
@@ -119,7 +115,6 @@ class AutofillSaveActivity : AppCompatActivity() {
formOrigin?.let {
AutofillMatcher.addMatchFor(this, it, File(createdPath))
}
- val longName = data.getStringExtra("LONG_NAME")!!
val password = data.getStringExtra("PASSWORD")
val resultIntent = if (password != null) {
// Password was generated and should be filled into a form.
@@ -144,15 +139,8 @@ class AutofillSaveActivity : AppCompatActivity() {
// Password was extracted from a form, there is nothing to fill.
Intent()
}
- // PasswordCreationActivity delegates committing the added file to PasswordStore. Since
- // PasswordStore is not involved in an AutofillScenario, we have to commit the file ourselves.
- lifecycleScope.launch {
- commitChange(
- getString(R.string.git_commit_add_text, longName),
- finishWithResultOnEnd = resultIntent
- )
- }
- // GitAsyncTask will finish the activity for us.
+ setResult(RESULT_OK, resultIntent)
+ finish()
}
}.launch(saveIntent)
}