Help and Feedback options are shown in the Action bar drop
down instead on the drawer when device has single account
and yet to sync.
b/13472406
The problem here was that MailActionBarView is created with
an UNKNOWN ViewMode. The ViewMode is changed for a variety
of reasons, but the one we're interested in is the initial
load of the Account object, which contains flags indicating
the account is waiting for initial sync.
Since loading the Account object is (correctly) asynchronous
there is a window of time where the user may open the
overflow menu while the ViewMode remains UNKNOWN. If this
occurs, MailActionBarView.onCreateOptionsMenu(Menu menu)
would immediately return without fetching pointers to the
menu items. This neuters all of our logic in
onPrepareOptionsMenu which attempts to adjust the visibility
of these menu items (since the references are all null).
Change-Id: I42581e2d0a6b7aa5570fa1ff3383e23595dd0800
1 file changed