summaryrefslogtreecommitdiff
path: root/autofill-parser/src
diff options
context:
space:
mode:
Diffstat (limited to 'autofill-parser/src')
-rw-r--r--autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt
index 7d572ba8..1a7e669e 100644
--- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt
+++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt
@@ -48,7 +48,6 @@ import androidx.annotation.RequiresApi
check whether it correctly distinguishes web origins even if iframes are present on the page.
You can use https://fabianhenneke.github.io/Android-Password-Store/ as a test form.
*/
-
/*
* **Security assumption**: Browsers on this list correctly report the web origin of the top-level
* window as part of their AssistStructure.
@@ -208,7 +207,14 @@ private fun getBrowserAutofillSupportLevel(context: Context, appPackage: String)
browserInfo.multiOriginMethod == BrowserMultiOriginMethod.None -> BrowserAutofillSupportLevel.PasswordFill
browserInfo.saveFlags == null -> BrowserAutofillSupportLevel.GeneralFill
else -> BrowserAutofillSupportLevel.GeneralFillAndSave
+ }.takeUnless { supportLevel ->
+ // On Android Oreo, only browsers with native Autofill support can be used with Password Store
+ // (compatibility mode is only available on Android Pie and higher). Since all known browsers
+ // with native Autofill support offer full save support as well, we reuse the list of those
+ // browsers here.
+ supportLevel != BrowserAutofillSupportLevel.GeneralFillAndSave && Build.VERSION.SDK_INT < Build.VERSION_CODES.P
}
+ ?: BrowserAutofillSupportLevel.None
}
@RequiresApi(Build.VERSION_CODES.O)