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
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index db7fd3f..a5852ba 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -265,7 +265,7 @@
             List<OptionItem> actions = getSupportedResizeActions(host, info);
             Rect pos = new Rect();
             mLauncher.getDragLayer().getDescendantRectRelativeToSelf(host, pos);
-            ArrowPopup popup = OptionsPopupView.show(mLauncher, new RectF(pos), actions);
+            ArrowPopup popup = OptionsPopupView.show(mLauncher, new RectF(pos), actions, false);
             popup.requestFocus();
             popup.setOnCloseCallback(host::requestFocus);
             return true;
@@ -294,15 +294,17 @@
         if ((providerInfo.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0) {
             if (layout.isRegionVacant(info.cellX + info.spanX, info.cellY, 1, info.spanY) ||
                     layout.isRegionVacant(info.cellX - 1, info.cellY, 1, info.spanY)) {
-                actions.add(new OptionItem(
-                        R.string.action_increase_width, R.drawable.ic_widget_width_increase,
+                actions.add(new OptionItem(mLauncher,
+                        R.string.action_increase_width,
+                        R.drawable.ic_widget_width_increase,
                         IGNORE,
                         v -> performResizeAction(R.string.action_increase_width, host, info)));
             }
 
             if (info.spanX > info.minSpanX && info.spanX > 1) {
-                actions.add(new OptionItem(
-                        R.string.action_decrease_width, R.drawable.ic_widget_width_decrease,
+                actions.add(new OptionItem(mLauncher,
+                        R.string.action_decrease_width,
+                        R.drawable.ic_widget_width_decrease,
                         IGNORE,
                         v -> performResizeAction(R.string.action_decrease_width, host, info)));
             }
@@ -311,15 +313,17 @@
         if ((providerInfo.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0) {
             if (layout.isRegionVacant(info.cellX, info.cellY + info.spanY, info.spanX, 1) ||
                     layout.isRegionVacant(info.cellX, info.cellY - 1, info.spanX, 1)) {
-                actions.add(new OptionItem(
-                        R.string.action_increase_height, R.drawable.ic_widget_height_increase,
+                actions.add(new OptionItem(mLauncher,
+                        R.string.action_increase_height,
+                        R.drawable.ic_widget_height_increase,
                         IGNORE,
                         v -> performResizeAction(R.string.action_increase_height, host, info)));
             }
 
             if (info.spanY > info.minSpanY && info.spanY > 1) {
-                actions.add(new OptionItem(
-                        R.string.action_decrease_height, R.drawable.ic_widget_height_decrease,
+                actions.add(new OptionItem(mLauncher,
+                        R.string.action_decrease_height,
+                        R.drawable.ic_widget_height_decrease,
                         IGNORE,
                         v -> performResizeAction(R.string.action_decrease_height, host, info)));
             }