Talkback issue in Dialer Settings for back button
The voice prompt for the back button in dialer settings for Blocked
numbers, Calls, and Quick Responses displays "Navigate up" instead of
"Back". This is expected because it indicates that there is a view one
level higher where the aforementioned views were invoked from. Hence,
talkback assistant prompts user to "Navigate up (one level)".
To resolve the issue, we can provide an alternate content description
for back navigation by invoking setHomeActionContentDescription on the
given ActionBar instance.
Bug: 239758276
Test: Manual Test
Change-Id: Ia97ef97a4b5ad589541848dcc210420c13ed8700
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bf5abca..d3196b9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -381,4 +381,6 @@
<string name="developer_enhanced_call_blocking" translatable="false">Enhanced Call Blocking</string>
<!-- Button label for generic cancel action [CHAR LIMIT=20] -->
<string name="cancel">Cancel</string>
+ <!-- Button label for generic back action [CHAR LIMIT=20] -->
+ <string name="back">Back</string>
</resources>
diff --git a/src/com/android/server/telecom/RespondViaSmsSettings.java b/src/com/android/server/telecom/RespondViaSmsSettings.java
index 661038b..d038a6e 100755
--- a/src/com/android/server/telecom/RespondViaSmsSettings.java
+++ b/src/com/android/server/telecom/RespondViaSmsSettings.java
@@ -89,6 +89,8 @@
if (actionBar != null) {
// android.R.id.home will be triggered in onOptionsItemSelected()
actionBar.setDisplayHomeAsUpEnabled(true);
+ // set the talkback voice prompt to "Back" instead of "Navigate Up"
+ actionBar.setHomeActionContentDescription(R.string.back);
}
}
diff --git a/src/com/android/server/telecom/settings/BlockedNumbersActivity.java b/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
index bc54e11..6e2eb97 100644
--- a/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
+++ b/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
@@ -101,6 +101,8 @@
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
+ // set the talkback voice prompt to "Back" instead of "Navigate Up"
+ actionBar.setHomeActionContentDescription(R.string.back);
}
if (!BlockedNumberContract.canCurrentUserBlockNumbers(this)) {