aboutsummaryrefslogtreecommitdiff
path: root/autofill-parser/src/main
diff options
context:
space:
mode:
authorFabian Meumertzheim <fabian@meumertzhe.im>2021-04-06 08:50:24 +0200
committerGitHub <noreply@github.com>2021-04-06 12:20:24 +0530
commit474770c5e38ac6f6519ed2ac54f0d0c52addbb0f (patch)
tree271348f4e8ba4a7626410026146cfb09a4dff376 /autofill-parser/src/main
parentcf5f0eae3a5dbaf36b17425e4c8d5d8dc43e6866 (diff)
Mark non-native Autofill browsers as unsupported on Oreo (#1370)
Android Oreo lacks the Autofill compatibility mode for browsers, which means that browsers without explicit Android support will not trigger Autofill events on web sites.
Diffstat (limited to 'autofill-parser/src/main')
-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)