Merge "Add a11y text for disappearing preference" into sc-dev

This commit is contained in:
Julia Reynolds
2021-06-17 16:03:25 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -9104,9 +9104,12 @@
<!-- [CHAR LIMIT=60] button title --> <!-- [CHAR LIMIT=60] button title -->
<string name="conversation_settings_clear_recents">Clear recent conversations</string> <string name="conversation_settings_clear_recents">Clear recent conversations</string>
<!-- a11y feedeback for 'clear recents' button' --> <!-- a11y feedback for 'clear recents' button' -->
<string name="recent_convos_removed">Recent conversations removed</string> <string name="recent_convos_removed">Recent conversations removed</string>
<!-- a11y feedback for 'clear recent conversation' button' -->
<string name="recent_convo_removed">Conversation removed</string>
<!-- a11y string --> <!-- a11y string -->
<string name="clear">Clear</string> <string name="clear">Clear</string>

View File

@@ -167,6 +167,8 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
pref.setOnClearClickListener(() -> { pref.setOnClearClickListener(() -> {
try { try {
mPs.removeRecentConversation(pkg, UserHandle.getUserId(uid), conversationId); mPs.removeRecentConversation(pkg, UserHandle.getUserId(uid), conversationId);
pref.getClearView().announceForAccessibility(
mContext.getString(R.string.recent_convo_removed));
parent.removePreference(pref); parent.removePreference(pref);
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.w(TAG, "Could not clear recent", e); Slog.w(TAG, "Could not clear recent", e);