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

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

Be more consistent with Q when the tabs feature flag is disabled.

This change involves 2 things:
- Check when there are apps on the other profile when deciding
whether to autolaunch with the tabs disabled
- Only take into account the rebuildInactiveTab result when
the tabbed view is enabled. Otherwise it's always false and
that always calls postRebuildList with false.

Fixes: 149031386
Test: manual
Change-Id: I166b3abca3c0da38b3c496b34f139107f6b56410
parent 367de77f
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1304,8 +1304,11 @@ public class ResolverActivity extends Activity implements
                    + "cannot be null.");
        }
        // We partially rebuild the inactive adapter to determine if we should auto launch
        boolean rebuildActiveCompleted = mMultiProfilePagerAdapter.rebuildActiveTab(true);
        boolean rebuildCompleted = mMultiProfilePagerAdapter.rebuildActiveTab(true);
        if (hasWorkProfile() && ENABLE_TABBED_VIEW) {
            boolean rebuildInactiveCompleted = mMultiProfilePagerAdapter.rebuildInactiveTab(false);
            rebuildCompleted = rebuildCompleted && rebuildInactiveCompleted;
        }

        if (useLayoutWithDefault()) {
            mLayoutId = R.layout.resolver_list_with_default;
@@ -1314,7 +1317,7 @@ public class ResolverActivity extends Activity implements
        }
        setContentView(mLayoutId);
        mMultiProfilePagerAdapter.setupViewPager(findViewById(R.id.profile_pager));
        return postRebuildList(rebuildActiveCompleted && rebuildInactiveCompleted);
        return postRebuildList(rebuildCompleted);
    }

    /**
@@ -1378,6 +1381,10 @@ public class ResolverActivity extends Activity implements
            return false;
        }

        if (mMultiProfilePagerAdapter.getActiveListAdapter().getOtherProfile() != null) {
            return false;
        }

        // Only one target, so we're a candidate to auto-launch!
        final TargetInfo target = mMultiProfilePagerAdapter.getActiveListAdapter()
                .targetInfoForPosition(0, false);