Talkback improvements for Settings screens.

Bug: 21164141
Change-Id: I7444261ccf967f6db70c9fe44a00bd3f19ceb975
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index 6ab36c1..b6cbebe 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -168,6 +168,24 @@
 
         final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
         loadAccountList(um);
+        StringBuffer contentDescription = new StringBuffer();
+        View masterClearContainer = mContentView.findViewById(R.id.master_clear_container);
+        getContentDescription(masterClearContainer, contentDescription);
+        masterClearContainer.setContentDescription(contentDescription);
+    }
+
+    private void getContentDescription(View v, StringBuffer description) {
+       if (v instanceof ViewGroup) {
+           ViewGroup vGroup = (ViewGroup) v;
+           for (int i = 0; i < vGroup.getChildCount(); i++) {
+               View nextChild = vGroup.getChildAt(i);
+               getContentDescription(nextChild, description);
+           }
+       } else if (v instanceof TextView) {
+           TextView vText = (TextView) v;
+           description.append(vText.getText());
+           description.append(","); // Allow Talkback to pause between sections.
+       }
     }
 
     private boolean isExtStorageEncrypted() {