Ensure the toolbar refreshes its PendingIntents when it changes.
A bug in FloatingToolbar.isCurrentlyShowing(menuItems) caused the
toolbar not to update the menu item action in certain cases where the
text selection changed but the toolbar menu items did not change.
e.g. Fires a Translate PendingIntent with the wrong text selection.
This CL fixes that.
isCurrentlyShowing(menuItems) aims to help avoid the re-building of
toolbar views when unnecessary. This fix still maintains this idea
but ensures that the menuItem references are updated so that the
correct click listener is triggered when the menu item button is
clicked.
Bug: 150973392
Test: Manually tested. See bug for how to reproduce.
Test: atest android.widget.TextViewActivityTest
Test: atest android.view.textclassifier.cts.TextViewIntegrationTest
Test: atest android.widget.cts.TextViewTest
Change-Id: Iefedf40e1ea6f9499401918ab34d3ebac53fc385
3 files changed