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

Commit 8519218a authored by arangelov's avatar arangelov Committed by Antoan Angelov
Browse files

Initialize workProfileUserHandle before initial check for work tabs

The shouldShowTabs() call checks for the existence of the work
profile user, which is actually initialized after that call.

Fixes: 156462936
Test: manual
Test: atest ChooserActivityTest
Test: atest ResolverActivityTest
Change-Id: Iff840826f7b008420f1a254c1044c05c27764d0c
parent 989150cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -358,6 +358,7 @@ public class ResolverActivity extends Activity implements
                : isHttpSchemeAndViewAction(getTargetIntent());
                : isHttpSchemeAndViewAction(getTargetIntent());


        mSupportsAlwaysUseOption = supportsAlwaysUseOption;
        mSupportsAlwaysUseOption = supportsAlwaysUseOption;
        mWorkProfileUserHandle = fetchWorkProfileUserProfile();


        // The last argument of createResolverListAdapter is whether to do special handling
        // The last argument of createResolverListAdapter is whether to do special handling
        // of the last used choice to highlight it in the list.  We need to always
        // of the last used choice to highlight it in the list.  We need to always
@@ -366,7 +367,6 @@ public class ResolverActivity extends Activity implements
        // to handle. We also turn it off when the work tab is shown to simplify the UX.
        // to handle. We also turn it off when the work tab is shown to simplify the UX.
        boolean filterLastUsed = mSupportsAlwaysUseOption && !isVoiceInteraction()
        boolean filterLastUsed = mSupportsAlwaysUseOption && !isVoiceInteraction()
                && !shouldShowTabs();
                && !shouldShowTabs();
        mWorkProfileUserHandle = fetchWorkProfileUserProfile();
        mMultiProfilePagerAdapter = createMultiProfilePagerAdapter(initialIntents, rList, filterLastUsed);
        mMultiProfilePagerAdapter = createMultiProfilePagerAdapter(initialIntents, rList, filterLastUsed);
        if (configureContentView()) {
        if (configureContentView()) {
            return;
            return;