Fix for bug where Talkback announce Folder:null

Bug: 385046797
Test: Verified this works locally.
Flag: EXEMPT bug fix
Change-Id: I9ad23f351df078b6bd40ff861e13b9109bfa8993
This commit is contained in:
Stefan Andonian committed 2024-12-30 14:01:28 -08:00
1 parent bf5e7e867f
commit 25283f0f45
2 files changed
+6

No files matched your search

@@ -816,6 +816,10 @@ public class FolderIcon extends FrameLayout implements FolderListener, FloatingI
* Returns a formatted accessibility title for folder
*/
public String getAccessiblityTitle(CharSequence title) {
if (title == null) {
// Avoids "Talkback -> Folder: null" announcement.
title = getContext().getString(R.string.unnamed_folder);
}
int size = mInfo.getContents().size();
if (size < MAX_NUM_ITEMS_IN_PREVIEW) {
return getContext().getString(R.string.folder_name_format_exact, title, size);