Commit 638112da authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

[Smart Selection] Fix wrong icon in work profile

We want to set icon to null when shouldShowIcon() returns false for
primary action.

Bug: 869500, b/111806618
Change-Id: I44203568fb167899ab25fd5d2d3dff13f6723c46
Reviewed-on: https://chromium-review.googlesource.com/1157120Reviewed-by: default avatarPedro Amaral <amaralp@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579552}
parent f7521c9c
......@@ -46,9 +46,11 @@ public class AdditionalMenuItemProviderImpl implements AdditionalMenuItemProvide
if (count > 0) {
RemoteAction primaryAction = classification.getActions().get(0);
MenuItem item = menu.findItem(android.R.id.textAssist);
if (primaryAction.shouldShowIcon()) {
MenuItem item = menu.findItem(android.R.id.textAssist);
item.setIcon(primaryAction.getIcon().loadDrawable(context));
} else {
item.setIcon(null);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment