Autofill: fix missing focus/ripple effect for authentication view
When there is authentication view, autofill does not use ListView, so
it's missing the focus/ripple effect. This CL let the parent of
authentication view use the same ripple drawable as ListView.
Test: manual test on phone and TV
atest CtsAutoFillServiceTestCases
Bug: b/79980365
Change-Id: Ief15304a3e533dbd6f45b7925db0b0c39977fd04
diff --git a/core/res/res/layout/autofill_dataset_picker.xml b/core/res/res/layout/autofill_dataset_picker.xml
index a88836e..dca0128 100644
--- a/core/res/res/layout/autofill_dataset_picker.xml
+++ b/core/res/res/layout/autofill_dataset_picker.xml
@@ -18,6 +18,7 @@
android:id="@+id/autofill_dataset_picker"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
+ android:foreground="?attr/listChoiceBackgroundIndicator"
style="@style/AutofillDatasetPicker">
<ListView
diff --git a/core/res/res/layout/autofill_dataset_picker_fullscreen.xml b/core/res/res/layout/autofill_dataset_picker_fullscreen.xml
index 1d2b5e5..90435e9 100644
--- a/core/res/res/layout/autofill_dataset_picker_fullscreen.xml
+++ b/core/res/res/layout/autofill_dataset_picker_fullscreen.xml
@@ -60,12 +60,13 @@
</LinearLayout>
- <!-- autofill_container is the common parent for inserting authentication item or
- autofill_dataset_list, autofill_dataset_foolter-->
+ <!-- autofill_dataset_picker is the common parent for inserting authentication item or
+ autofill_dataset_list, autofill_dataset_footer-->
<LinearLayout
android:layout_width="304dp"
android:layout_height="wrap_content"
android:id="@+id/autofill_dataset_picker"
+ android:foreground="?attr/listChoiceBackgroundIndicator"
android:orientation="vertical">
<ListView
android:id="@+id/autofill_dataset_list"
@@ -83,4 +84,4 @@
android:orientation="vertical"/>
</LinearLayout>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/core/res/res/layout/autofill_dataset_picker_header_footer.xml b/core/res/res/layout/autofill_dataset_picker_header_footer.xml
index 093f035..4d5f4f0 100644
--- a/core/res/res/layout/autofill_dataset_picker_header_footer.xml
+++ b/core/res/res/layout/autofill_dataset_picker_header_footer.xml
@@ -18,6 +18,7 @@
android:id="@+id/autofill_dataset_picker"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
+ android:foreground="?attr/listChoiceBackgroundIndicator"
style="@style/AutofillDatasetPicker">
<LinearLayout
diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
index 1aeb3b9..8119054 100644
--- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
@@ -228,8 +228,8 @@
mWindow = null;
return;
}
- decor.setFocusable(true);
- decor.setOnClickListener(v -> mCallback.onResponsePicked(response));
+ container.setFocusable(true);
+ container.setOnClickListener(v -> mCallback.onResponsePicked(response));
if (!mFullScreen) {
final Point maxSize = mTempPoint;