Loading core/java/com/android/internal/app/AbstractMultiProfilePagerAdapter.java +2 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,8 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter { Button button = emptyStateView.findViewById(R.id.resolver_empty_state_button); button.setVisibility(buttonOnClick != null ? View.VISIBLE : View.GONE); button.setOnClickListener(buttonOnClick); activeListAdapter.markTabLoaded(); } private void showSpinner(View emptyStateView) { Loading core/java/com/android/internal/app/ResolverActivity.java +7 −4 Original line number Diff line number Diff line Loading @@ -1339,9 +1339,12 @@ public class ResolverActivity extends Activity implements + "cannot be null."); } // We partially rebuild the inactive adapter to determine if we should auto launch boolean rebuildCompleted = mMultiProfilePagerAdapter.rebuildActiveTab(true); // isTabLoaded will be true here if the empty state screen is shown instead of the list. boolean rebuildCompleted = mMultiProfilePagerAdapter.rebuildActiveTab(true) || mMultiProfilePagerAdapter.getActiveListAdapter().isTabLoaded(); if (shouldShowTabs()) { boolean rebuildInactiveCompleted = mMultiProfilePagerAdapter.rebuildInactiveTab(false); boolean rebuildInactiveCompleted = mMultiProfilePagerAdapter.rebuildInactiveTab(false) || mMultiProfilePagerAdapter.getInactiveListAdapter().isTabLoaded(); rebuildCompleted = rebuildCompleted && rebuildInactiveCompleted; } Loading Loading @@ -1401,8 +1404,8 @@ public class ResolverActivity extends Activity implements if (numberOfProfiles == 1 && maybeAutolaunchIfSingleTarget()) { return true; } else if (numberOfProfiles == 2 && mMultiProfilePagerAdapter.getActiveListAdapter().isListLoaded() && mMultiProfilePagerAdapter.getInactiveListAdapter().isListLoaded() && mMultiProfilePagerAdapter.getActiveListAdapter().isTabLoaded() && mMultiProfilePagerAdapter.getInactiveListAdapter().isTabLoaded() && (maybeAutolaunchIfNoAppsOnInactiveTab() || maybeAutolaunchIfCrossProfileSupported())) { return true; Loading core/java/com/android/internal/app/ResolverListAdapter.java +9 −5 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class ResolverListAdapter extends BaseAdapter { private final ResolverListCommunicator mResolverListCommunicator; private Runnable mPostListReadyRunnable; private final boolean mIsAudioCaptureDevice; private boolean mIsListLoaded; private boolean mIsTabLoaded; public ResolverListAdapter(Context context, List<Intent> payloadIntents, Intent[] initialIntents, List<ResolveInfo> rList, Loading Loading @@ -192,7 +192,7 @@ public class ResolverListAdapter extends BaseAdapter { mLastChosenPosition = -1; mAllTargetsAreBrowsers = false; mDisplayList.clear(); mIsListLoaded = false; mIsTabLoaded = false; if (mBaseResolveList != null) { currentResolveList = mUnfilteredResolveList = new ArrayList<>(); Loading Loading @@ -354,7 +354,7 @@ public class ResolverListAdapter extends BaseAdapter { mResolverListCommunicator.sendVoiceChoicesIfNeeded(); postListReadyRunnable(doPostProcessing); mIsListLoaded = true; mIsTabLoaded = true; } /** Loading Loading @@ -614,8 +614,12 @@ public class ResolverListAdapter extends BaseAdapter { return mIntents; } protected boolean isListLoaded() { return mIsListLoaded; protected boolean isTabLoaded() { return mIsTabLoaded; } protected void markTabLoaded() { mIsTabLoaded = true; } /** Loading Loading
core/java/com/android/internal/app/AbstractMultiProfilePagerAdapter.java +2 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,8 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter { Button button = emptyStateView.findViewById(R.id.resolver_empty_state_button); button.setVisibility(buttonOnClick != null ? View.VISIBLE : View.GONE); button.setOnClickListener(buttonOnClick); activeListAdapter.markTabLoaded(); } private void showSpinner(View emptyStateView) { Loading
core/java/com/android/internal/app/ResolverActivity.java +7 −4 Original line number Diff line number Diff line Loading @@ -1339,9 +1339,12 @@ public class ResolverActivity extends Activity implements + "cannot be null."); } // We partially rebuild the inactive adapter to determine if we should auto launch boolean rebuildCompleted = mMultiProfilePagerAdapter.rebuildActiveTab(true); // isTabLoaded will be true here if the empty state screen is shown instead of the list. boolean rebuildCompleted = mMultiProfilePagerAdapter.rebuildActiveTab(true) || mMultiProfilePagerAdapter.getActiveListAdapter().isTabLoaded(); if (shouldShowTabs()) { boolean rebuildInactiveCompleted = mMultiProfilePagerAdapter.rebuildInactiveTab(false); boolean rebuildInactiveCompleted = mMultiProfilePagerAdapter.rebuildInactiveTab(false) || mMultiProfilePagerAdapter.getInactiveListAdapter().isTabLoaded(); rebuildCompleted = rebuildCompleted && rebuildInactiveCompleted; } Loading Loading @@ -1401,8 +1404,8 @@ public class ResolverActivity extends Activity implements if (numberOfProfiles == 1 && maybeAutolaunchIfSingleTarget()) { return true; } else if (numberOfProfiles == 2 && mMultiProfilePagerAdapter.getActiveListAdapter().isListLoaded() && mMultiProfilePagerAdapter.getInactiveListAdapter().isListLoaded() && mMultiProfilePagerAdapter.getActiveListAdapter().isTabLoaded() && mMultiProfilePagerAdapter.getInactiveListAdapter().isTabLoaded() && (maybeAutolaunchIfNoAppsOnInactiveTab() || maybeAutolaunchIfCrossProfileSupported())) { return true; Loading
core/java/com/android/internal/app/ResolverListAdapter.java +9 −5 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class ResolverListAdapter extends BaseAdapter { private final ResolverListCommunicator mResolverListCommunicator; private Runnable mPostListReadyRunnable; private final boolean mIsAudioCaptureDevice; private boolean mIsListLoaded; private boolean mIsTabLoaded; public ResolverListAdapter(Context context, List<Intent> payloadIntents, Intent[] initialIntents, List<ResolveInfo> rList, Loading Loading @@ -192,7 +192,7 @@ public class ResolverListAdapter extends BaseAdapter { mLastChosenPosition = -1; mAllTargetsAreBrowsers = false; mDisplayList.clear(); mIsListLoaded = false; mIsTabLoaded = false; if (mBaseResolveList != null) { currentResolveList = mUnfilteredResolveList = new ArrayList<>(); Loading Loading @@ -354,7 +354,7 @@ public class ResolverListAdapter extends BaseAdapter { mResolverListCommunicator.sendVoiceChoicesIfNeeded(); postListReadyRunnable(doPostProcessing); mIsListLoaded = true; mIsTabLoaded = true; } /** Loading Loading @@ -614,8 +614,12 @@ public class ResolverListAdapter extends BaseAdapter { return mIntents; } protected boolean isListLoaded() { return mIsListLoaded; protected boolean isTabLoaded() { return mIsTabLoaded; } protected void markTabLoaded() { mIsTabLoaded = true; } /** Loading