9000e3f38fc0

make locked picker inline dataset renderable with Samsung Gboard

time
2026-09-06 14:17 UTC · 1 month ago
machine
koh2
agent
claude-opus-5
session
credential search remember
parent
0bf8b57c3a19
1 file app/src/main/java/com/peachpasswords/autofill/AutofillResponseBuilder.kt+11 −6
app/src/main/java/com/peachpasswords/autofill/AutofillResponseBuilder.kt+11 −6
@@ -421,16 +421,21 @@421421             null422422         }423423         val builder = Dataset.Builder(menu)424-        (listOfNotNull(424+        val fieldIds = listOfNotNull(425425             parsed.identityId, parsed.passwordId, parsed.otpId,426426             parsed.cardNumberId, parsed.cardExpMonthId, parsed.cardExpYearId,427427             parsed.cardExpDateId, parsed.cardCvcId, parsed.cardNameId,428-        ) + parsed.otpDigitBoxIds).forEach { id ->429-            if (inline != null && Build.VERSION.SDK_INT >= 30) {430-                builder.setValue(id, null, menu, inline)431-            } else {432-                builder.setValue(id, null, menu)428+        ) + parsed.otpDigitBoxIds429+        if (inline != null && Build.VERSION.SDK_INT >= 30) {430+            // Samsung's inline renderer drops authenticated datasets whose only431+            // field values are null. Bind the chip to one credential field with432+            // an empty value; authentication still supplies the real dataset.433+            fieldIds.firstOrNull()?.let { id ->434+                builder.setValue(id, AutofillValue.forText(""), menu, inline)433435             }436+            fieldIds.drop(1).forEach { id -> builder.setValue(id, null, menu) }437+        } else {438+            fieldIds.forEach { id -> builder.setValue(id, null, menu) }434439         }435440         builder.setAuthentication(AutofillIntents.pickerIntentSender(context, parsed))436441         return builder.build()

view file