Loading src/com/android/documentsui/BaseActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ import com.android.documentsui.roots.ProvidersCache; import com.android.documentsui.sidebar.RootsFragment; import com.android.documentsui.sorting.SortController; import com.android.documentsui.sorting.SortModel; import com.android.modules.utils.build.SdkLevel; import com.google.android.material.appbar.AppBarLayout; Loading Loading @@ -307,7 +308,7 @@ public abstract class BaseActivity // If private space feature flag is enabled, we should store the intent that launched docsUi // so that we can use this intent to get CrossProfileResolveInfo when ever we want to, // for example when ACTION_PROFILE_AVAILABLE intent is received if (mUserManagerState != null) { if (mUserManagerState != null && SdkLevel.isAtLeastS()) { mUserManagerState.setCurrentStateIntent(intent); } mSearchManager = new SearchViewManager(searchListener, queryInterceptor, Loading src/com/android/documentsui/DirectoryLoader.java +2 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.documentsui.base.State; import com.android.documentsui.base.UserId; import com.android.documentsui.roots.RootCursorWrapper; import com.android.documentsui.sorting.SortModel; import com.android.modules.utils.build.SdkLevel; import java.util.ArrayList; import java.util.List; Loading Loading @@ -331,7 +332,7 @@ public class DirectoryLoader extends AsyncTaskLoader<DirectoryResult> { } private List<UserId> getUserIds() { if (mState.configStore.isPrivateSpaceInDocsUIEnabled()) { if (mState.configStore.isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { return DocumentsApplication.getUserManagerState(getContext()).getUserIds(); } return DocumentsApplication.getUserIdManager(getContext()).getUserIds(); Loading src/com/android/documentsui/DocumentsApplication.java +3 −2 Original line number Diff line number Diff line Loading @@ -127,7 +127,8 @@ public class DocumentsApplication extends Application { public static UserManagerState getUserManagerState(Context context) { UserManagerState userManagerState = ((DocumentsApplication) context.getApplicationContext()).mUserManagerState; if (userManagerState == null && getConfigStore().isPrivateSpaceInDocsUIEnabled()) { if (userManagerState == null && getConfigStore().isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { userManagerState = UserManagerState.create(context); ((DocumentsApplication) context.getApplicationContext()).mUserManagerState = userManagerState; Loading Loading @@ -264,7 +265,7 @@ public class DocumentsApplication extends Application { } else if (PROFILE_FILTER_ACTIONS.contains(action)) { // Make the changes to UserManagerState object before calling providers updateAsync // so that providers for all the users are loaded if (getConfigStore().isPrivateSpaceInDocsUIEnabled()) { if (getConfigStore().isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER); UserId userId = UserId.of(userHandle); getUserManagerState(context).onProfileActionStatusChange(action, userId); Loading src/com/android/documentsui/ProfileTabs.java +3 −2 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ public class ProfileTabs implements ProfileTabsAddons { mUserIds.addAll(userIds); mTabs.removeAllTabs(); if (mUserIds.size() > 1) { if (mConfigStore.isPrivateSpaceInDocsUIEnabled()) { if (mConfigStore.isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { addTabsPrivateSpaceEnabled(); } else { addTabsPrivateSpaceDisabled(); Loading @@ -190,7 +190,7 @@ public class ProfileTabs implements ProfileTabsAddons { } private List<UserId> getUserIds() { if (mConfigStore.isPrivateSpaceInDocsUIEnabled()) { if (mConfigStore.isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { assert mUserManagerState != null; return mUserManagerState.getUserIds(); } Loading @@ -198,6 +198,7 @@ public class ProfileTabs implements ProfileTabsAddons { return mUserIdManager.getUserIds(); } @RequiresApi(Build.VERSION_CODES.S) private void addTabsPrivateSpaceEnabled() { // set setSelected to false otherwise it will trigger callback. assert mUserManagerState != null; Loading src/com/android/documentsui/UserManagerState.java +1 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; @RequiresApi(Build.VERSION_CODES.S) public interface UserManagerState { /** Loading Loading
src/com/android/documentsui/BaseActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ import com.android.documentsui.roots.ProvidersCache; import com.android.documentsui.sidebar.RootsFragment; import com.android.documentsui.sorting.SortController; import com.android.documentsui.sorting.SortModel; import com.android.modules.utils.build.SdkLevel; import com.google.android.material.appbar.AppBarLayout; Loading Loading @@ -307,7 +308,7 @@ public abstract class BaseActivity // If private space feature flag is enabled, we should store the intent that launched docsUi // so that we can use this intent to get CrossProfileResolveInfo when ever we want to, // for example when ACTION_PROFILE_AVAILABLE intent is received if (mUserManagerState != null) { if (mUserManagerState != null && SdkLevel.isAtLeastS()) { mUserManagerState.setCurrentStateIntent(intent); } mSearchManager = new SearchViewManager(searchListener, queryInterceptor, Loading
src/com/android/documentsui/DirectoryLoader.java +2 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.documentsui.base.State; import com.android.documentsui.base.UserId; import com.android.documentsui.roots.RootCursorWrapper; import com.android.documentsui.sorting.SortModel; import com.android.modules.utils.build.SdkLevel; import java.util.ArrayList; import java.util.List; Loading Loading @@ -331,7 +332,7 @@ public class DirectoryLoader extends AsyncTaskLoader<DirectoryResult> { } private List<UserId> getUserIds() { if (mState.configStore.isPrivateSpaceInDocsUIEnabled()) { if (mState.configStore.isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { return DocumentsApplication.getUserManagerState(getContext()).getUserIds(); } return DocumentsApplication.getUserIdManager(getContext()).getUserIds(); Loading
src/com/android/documentsui/DocumentsApplication.java +3 −2 Original line number Diff line number Diff line Loading @@ -127,7 +127,8 @@ public class DocumentsApplication extends Application { public static UserManagerState getUserManagerState(Context context) { UserManagerState userManagerState = ((DocumentsApplication) context.getApplicationContext()).mUserManagerState; if (userManagerState == null && getConfigStore().isPrivateSpaceInDocsUIEnabled()) { if (userManagerState == null && getConfigStore().isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { userManagerState = UserManagerState.create(context); ((DocumentsApplication) context.getApplicationContext()).mUserManagerState = userManagerState; Loading Loading @@ -264,7 +265,7 @@ public class DocumentsApplication extends Application { } else if (PROFILE_FILTER_ACTIONS.contains(action)) { // Make the changes to UserManagerState object before calling providers updateAsync // so that providers for all the users are loaded if (getConfigStore().isPrivateSpaceInDocsUIEnabled()) { if (getConfigStore().isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER); UserId userId = UserId.of(userHandle); getUserManagerState(context).onProfileActionStatusChange(action, userId); Loading
src/com/android/documentsui/ProfileTabs.java +3 −2 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ public class ProfileTabs implements ProfileTabsAddons { mUserIds.addAll(userIds); mTabs.removeAllTabs(); if (mUserIds.size() > 1) { if (mConfigStore.isPrivateSpaceInDocsUIEnabled()) { if (mConfigStore.isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { addTabsPrivateSpaceEnabled(); } else { addTabsPrivateSpaceDisabled(); Loading @@ -190,7 +190,7 @@ public class ProfileTabs implements ProfileTabsAddons { } private List<UserId> getUserIds() { if (mConfigStore.isPrivateSpaceInDocsUIEnabled()) { if (mConfigStore.isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) { assert mUserManagerState != null; return mUserManagerState.getUserIds(); } Loading @@ -198,6 +198,7 @@ public class ProfileTabs implements ProfileTabsAddons { return mUserIdManager.getUserIds(); } @RequiresApi(Build.VERSION_CODES.S) private void addTabsPrivateSpaceEnabled() { // set setSelected to false otherwise it will trigger callback. assert mUserManagerState != null; Loading
src/com/android/documentsui/UserManagerState.java +1 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; @RequiresApi(Build.VERSION_CODES.S) public interface UserManagerState { /** Loading