Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8913b59 authored by Matt Casey's avatar Matt Casey
Browse files

ChooserActivity: fix NPE for non-work profiles

See ag/26029901 for crash details.

Bug: 355835830
Test: atest ChooserActivityTest
Flag: EXEMPT bugfix
Change-Id: Icabd33bc32763b46e49aba1eb0d738bfc8449347
parent 863e0121
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2952,10 +2952,10 @@ public class ChooserActivity extends ResolverActivity implements
    }

    private boolean shouldShowStickyContentPreviewNoOrientationCheck() {
        return shouldShowTabs()
                && (mMultiProfilePagerAdapter.getListAdapterForUserHandle(
                        UserHandle.of(UserHandle.myUserId())).getCount() > 0
                    || shouldShowStickyContentPreviewWhenEmpty())
        ResolverListAdapter adapter = mMultiProfilePagerAdapter.getListAdapterForUserHandle(
                UserHandle.of(UserHandle.myUserId()));
        boolean isEmpty = adapter == null || adapter.getCount() == 0;
        return shouldShowTabs() && (!isEmpty || shouldShowStickyContentPreviewWhenEmpty())
                && shouldShowContentPreview();
    }