aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-03-26 10:03:54 +0100
committerGitHub <noreply@github.com>2020-03-26 14:33:54 +0530
commit5445899ab8e32df636b454933ee5edbd1b091551 (patch)
tree188d5355d0287201ca78e3986467737ee7ceb341 /app/src/main/java
parent8f722a2219f7a3cc74aa79ac29832d223fd20cad (diff)
Workaround: Prevent fill-in datasets from being shown on Android… (#666)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/oreo/Form.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/Form.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/Form.kt
index ab21f00c..6e405005 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/Form.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/Form.kt
@@ -213,7 +213,14 @@ class FillableForm private constructor(
): Dataset {
val remoteView = makePlaceholderRemoteView(context)
val scenario = AutofillScenario.fromBundle(clientState)
- return Dataset.Builder(remoteView).run {
+ // Before Android P, Datasets used for fill-in had to come with a RemoteViews, even
+ // though they are never shown.
+ val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ Dataset.Builder()
+ } else {
+ Dataset.Builder(remoteView)
+ }
+ return builder.run {
if (scenario != null) fillWith(scenario, action, credentials)
else e { "Failed to recover scenario from client state" }
build()