Updates OptionsPopupView to allow non-resource strings/icons.

This will be needed for Smartspace which gets its menu options
from AiAi.

Test: Hard-coded strings passed to Smartspace from the fake
data Launcher plugin. Also verified could access the menu
using TalkBack.
Bug: 184179894

Change-Id: I724c09db18085585c7a5224e32c0d8973acdab7c
This commit is contained in:
Andy Wickham
2021-04-01 16:04:44 -07:00
parent adcc940d4b
commit 7d821d98f1
3 changed files with 53 additions and 22 deletions

View File

@@ -67,7 +67,7 @@ public class AccessibilityActionsView extends View implements StateListener<Laun
info.addAction(new AccessibilityAction(
R.string.all_apps_button_label, l.getText(R.string.all_apps_button_label)));
for (OptionItem item : OptionsPopupView.getOptions(l)) {
info.addAction(new AccessibilityAction(item.labelRes, l.getText(item.labelRes)));
info.addAction(new AccessibilityAction(item.labelRes, item.label));
}
return info;
}