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
This commit is contained in:
committed by
Antoan Angelov
parent
367de77f1e
commit
db0c1f18c9
@@ -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 rebuildInactiveCompleted = mMultiProfilePagerAdapter.rebuildInactiveTab(false);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user