Add description to SIM import account dropdown arrow

Also make the same change for the account chooser in the editor.

test
manually verified that drop down arrow reads out "Show more" with
talkback on

Bug 32973740

Change-Id: I4050cbf37a6ba11300262716c5a6ab7c4f8d2a99
diff --git a/res/layout/editor_account_header.xml b/res/layout/editor_account_header.xml
index b9f4a14..01cc01f 100644
--- a/res/layout/editor_account_header.xml
+++ b/res/layout/editor_account_header.xml
@@ -72,6 +72,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical|end"
         android:layout_alignParentEnd="true"
+        android:contentDescription="@string/show_more_content_description"
         android:paddingStart="@dimen/editor_round_button_padding_left"
         android:paddingEnd="@dimen/editor_round_button_padding_right"
         android:paddingTop="@dimen/editor_round_button_padding_top"
diff --git a/res/layout/fragment_sim_import.xml b/res/layout/fragment_sim_import.xml
index f848cef..d7a83f5 100644
--- a/res/layout/fragment_sim_import.xml
+++ b/res/layout/fragment_sim_import.xml
@@ -85,6 +85,12 @@
                 android:layout_height="wrap_content"
                 android:layout_gravity="center_vertical"
                 android:layout_marginEnd="10dp"
+                android:background="@null"
+                android:clickable="true"
+                android:contentDescription="@string/show_more_content_description"
+                android:focusable="true"
+                android:minHeight="0dp"
+                android:minWidth="0dp"
                 android:scaleType="center"
                 android:src="@drawable/ic_arrow_drop_down_black_24dp"
                 android:tint="?android:textColorSecondary"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a50c155..f53d970 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1906,4 +1906,9 @@
     <!-- Generic label for the SIM card when there is only a single SIM in the device [CHAR LIMIT=10]-->
     <string name="single_sim_display_label">SIM</string>
 
+    <!-- Content description for dropdown arrow (https://material.io/icons/#ic_arrow_drop_down)
+         This is used to indicate that a list of options can be opened by tapping on it.
+         [CHAR LIMIT=NONE] -->
+    <string name="show_more_content_description">Show more</string>
+
 </resources>
diff --git a/src/com/android/contacts/editor/AccountHeaderPresenter.java b/src/com/android/contacts/editor/AccountHeaderPresenter.java
index d4f613b..440df94 100644
--- a/src/com/android/contacts/editor/AccountHeaderPresenter.java
+++ b/src/com/android/contacts/editor/AccountHeaderPresenter.java
@@ -203,6 +203,9 @@
         addAccountHeader(nameLabel);
         // Add handlers for choosing another account to save to.
         mAccountHeaderExpanderIcon.setVisibility(View.VISIBLE);
+        // Add the listener to the icon so that it will be announced by talkback as a clickable
+        // element
+        mAccountHeaderExpanderIcon.setOnClickListener(listener);
         mAccountHeaderContainer.setOnClickListener(listener);
     }
 
diff --git a/src/com/android/contacts/editor/RawContactEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java
index 8e177e4..3c142d6 100644
--- a/src/com/android/contacts/editor/RawContactEditorView.java
+++ b/src/com/android/contacts/editor/RawContactEditorView.java
@@ -753,7 +753,7 @@
     private void addAccountSelector(final RawContactDelta rawContactDelta) {
         // Add handlers for choosing another account to save to.
         mAccountHeaderExpanderIcon.setVisibility(View.VISIBLE);
-        mAccountHeaderContainer.setOnClickListener(new View.OnClickListener() {
+        final OnClickListener clickListener = new OnClickListener() {
             @Override
             public void onClick(View v) {
                 final ListPopupWindow popup = new ListPopupWindow(getContext(), null);
@@ -783,7 +783,11 @@
                 });
                 popup.show();
             }
-        });
+        };
+        mAccountHeaderContainer.setOnClickListener(clickListener);
+        // Make the expander icon clickable so that it will be announced as a button by
+        // talkback
+        mAccountHeaderExpanderIcon.setOnClickListener(clickListener);
     }
 
     private void addPhotoView() {