aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-09-21 23:44:52 +0530
committerGitHub <noreply@github.com>2020-09-21 23:44:52 +0530
commit0a9b8fc585a9a06d50ccdb8aef21a2794f700751 (patch)
treed89439f2213271cd81649ee0b939bf0efda1fbc8 /app/src/main/java
parent12db2d00df73b150054ddead1b0ee2af0370ddff (diff)
Remove Autofill onboarding prompt and cleanup strings (#1116)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt48
1 files changed, 1 insertions, 47 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
index eb339ac3..fc14d805 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
@@ -11,10 +11,8 @@ import android.content.Intent
import android.content.pm.ShortcutInfo.Builder
import android.content.pm.ShortcutManager
import android.graphics.drawable.Icon
-import android.net.Uri
import android.os.Build
import android.os.Bundle
-import android.provider.Settings
import android.view.KeyEvent
import android.view.Menu
import android.view.MenuItem
@@ -22,7 +20,6 @@ import android.view.MenuItem.OnActionExpandListener
import androidx.activity.result.contract.ActivityResultContracts.RequestPermission
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
import androidx.activity.viewModels
-import androidx.appcompat.widget.AppCompatTextView
import androidx.appcompat.widget.SearchView
import androidx.appcompat.widget.SearchView.OnQueryTextListener
import androidx.core.content.edit
@@ -35,8 +32,6 @@ import com.github.ajalt.timberkt.d
import com.github.ajalt.timberkt.e
import com.github.ajalt.timberkt.i
import com.github.ajalt.timberkt.w
-import com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel
-import com.github.androidpasswordstore.autofillparser.getInstalledBrowsersWithAutofillSupportLevel
import com.github.michaelbull.result.fold
import com.github.michaelbull.result.getOr
import com.github.michaelbull.result.onFailure
@@ -61,11 +56,11 @@ import com.zeapo.pwdstore.utils.PasswordRepository.Companion.initialize
import com.zeapo.pwdstore.utils.PasswordRepository.Companion.isInitialized
import com.zeapo.pwdstore.utils.PreferenceKeys
import com.zeapo.pwdstore.utils.base64
-import com.zeapo.pwdstore.utils.isPermissionGranted
import com.zeapo.pwdstore.utils.commitChange
import com.zeapo.pwdstore.utils.contains
import com.zeapo.pwdstore.utils.getString
import com.zeapo.pwdstore.utils.isInsideRepository
+import com.zeapo.pwdstore.utils.isPermissionGranted
import com.zeapo.pwdstore.utils.listFilesRecursively
import com.zeapo.pwdstore.utils.requestInputFocusOnView
import com.zeapo.pwdstore.utils.sharedPrefs
@@ -125,45 +120,6 @@ class PasswordStore : BaseGitActivity() {
shortcutManager = getSystemService()
}
- // If user is eligible for Oreo autofill, prompt them to switch.
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
- !settings.getBoolean(PREFERENCE_SEEN_AUTOFILL_ONBOARDING, false)) {
- MaterialAlertDialogBuilder(this).run {
- @SuppressLint("InflateParams")
- val layout =
- layoutInflater.inflate(R.layout.oreo_autofill_instructions, null)
- layout.findViewById<AppCompatTextView>(R.id.intro_text).setText(R.string.autofill_onboarding_dialog_message)
- val supportedBrowsersTextView =
- layout.findViewById<AppCompatTextView>(R.id.supportedBrowsers)
- supportedBrowsersTextView.text =
- getInstalledBrowsersWithAutofillSupportLevel(context).joinToString(
- separator = "\n"
- ) {
- val appLabel = it.first
- val supportDescription = when (it.second) {
- BrowserAutofillSupportLevel.None -> getString(R.string.oreo_autofill_no_support)
- BrowserAutofillSupportLevel.FlakyFill -> getString(R.string.oreo_autofill_flaky_fill_support)
- BrowserAutofillSupportLevel.PasswordFill -> getString(R.string.oreo_autofill_password_fill_support)
- BrowserAutofillSupportLevel.GeneralFill -> getString(R.string.oreo_autofill_general_fill_support)
- BrowserAutofillSupportLevel.GeneralFillAndSave -> getString(R.string.oreo_autofill_general_fill_and_save_support)
- }
- "$appLabel: $supportDescription"
- }
- setView(layout)
- setTitle(R.string.autofill_onboarding_dialog_title)
- setPositiveButton(R.string.dialog_ok) { _, _ ->
- startActivity(Intent(Settings.ACTION_REQUEST_SET_AUTOFILL_SERVICE).apply {
- data = Uri.parse("package:${BuildConfig.APPLICATION_ID}")
- })
- }
- setNegativeButton(R.string.dialog_cancel) { _, _ -> }
- setOnDismissListener {
- settings.edit { putBoolean(PREFERENCE_SEEN_AUTOFILL_ONBOARDING, true) }
- }
- show()
- }
- }
-
model.currentDir.observe(this) { dir ->
val basePath = getRepositoryDirectory().absoluteFile
supportActionBar!!.apply {
@@ -737,7 +693,5 @@ class PasswordStore : BaseGitActivity() {
return (!Character.isISOControl(c) &&
block != null && block !== UnicodeBlock.SPECIALS)
}
-
- private const val PREFERENCE_SEEN_AUTOFILL_ONBOARDING = "seen_autofill_onboarding"
}
}