From 25b426157417c97c61c3d2cc0d9fa556f337f22d Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 3 Jul 2020 12:54:06 +0530 Subject: Migrate to ActivityResultContracts (#910) * Move git directory selection to ActivityResultContracts Signed-off-by: Harsh Shandilya * global: replace all android.app.Activity references Signed-off-by: Harsh Shandilya * res: resolve ObsoleteSdkInt lint warning Signed-off-by: Harsh Shandilya * layout: silence some overdraw warnings Signed-off-by: Harsh Shandilya * PasswordFragment: address deprecation Signed-off-by: Harsh Shandilya * PasswordStore: start addressing deprecation warnings Signed-off-by: Harsh Shandilya * autofill: silence deprecation warnings for legacy implementation I don't want to ever touch these files Signed-off-by: Harsh Shandilya * Reset scrollTarget after use Signed-off-by: Harsh Shandilya * Refresh password list after each swipe Signed-off-by: Harsh Shandilya * Convert if to when Signed-off-by: Harsh Shandilya * Migrate UserPreference to ActivityResultContracts Signed-off-by: Harsh Shandilya * Also validate result in git directory selection Signed-off-by: Harsh Shandilya * AutofillSaveActivity: Switch to ActivityResultContracts Signed-off-by: Harsh Shandilya * AutofillDecryptActivity: Switch to ActivityResultContracts Signed-off-by: Harsh Shandilya * AutofillFilterActivity: Switch to ActivityResultContracts Signed-off-by: Harsh Shandilya * Improve deletion flow - Silently delete empty directory - Always refresh password list upon completion Signed-off-by: Harsh Shandilya * Uniform naming for activity result handlers Signed-off-by: Harsh Shandilya Co-authored-by: Fabian Henneke --- .../com/zeapo/pwdstore/git/config/SshApiSessionFactory.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/config') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java b/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java index 5a51d28a..aa62fdae 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java @@ -4,13 +4,13 @@ */ package com.zeapo.pwdstore.git.config; -import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.content.IntentSender; import android.content.SharedPreferences; import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; import androidx.preference.PreferenceManager; import com.google.android.material.dialog.MaterialAlertDialogBuilder; @@ -245,7 +245,7 @@ public class SshApiSessionFactory extends JschConfigSessionFactory { // back // though onActivityResult callingActivity.onActivityResult( - requestCode, Activity.RESULT_OK, null); + requestCode, AppCompatActivity.RESULT_OK, null); } @Override @@ -289,7 +289,7 @@ public class SshApiSessionFactory extends JschConfigSessionFactory { private final String description; private final String alg; private final byte[] publicKey; - private final Activity callingActivity; + private final AppCompatActivity callingActivity; private final SshAuthenticationApi api; private CountDownLatch latch; private byte[] signature; @@ -299,7 +299,7 @@ public class SshApiSessionFactory extends JschConfigSessionFactory { String description, byte[] publicKey, String alg, - Activity callingActivity, + AppCompatActivity callingActivity, SshAuthenticationApi api) { this.keyId = keyId; this.description = description; @@ -310,7 +310,7 @@ public class SshApiSessionFactory extends JschConfigSessionFactory { } @Override - public boolean setPassphrase(byte[] passphrase) throws JSchException { + public boolean setPassphrase(byte[] passphrase) { // We are not encrypted with a passphrase return true; } -- cgit v1.2.3