Update PhotoPicker UI if work profile becomes unavailable
Update work profile floating action button passively instead of doing
that actively every time onResume is called. The button will only be
updated when a relevant broadcast for a change in work profile user
is received.
When the user is in work profile mode, and the work profile is turned
off, we change the user profile back to personal user, and reset the
PhotoPicker UI such that it is the first launch: Photos chip is selected
and the user is at Photos tab.
Note: BottomSheet behavior is not reset to first launch state as we do
not re-initialise it.
PreviewFragment only needs to know if work profile was turned off, so
handle that case separately for PreviewFragment.
Bug: 191158884
Test: manual (videos attached to the bug)
Test: atest com.android.providers.media.photopicker.espresso
Change-Id: I1f8b37b436808b6e284b92b51b73ad50750fd904
8 files changed