Implements profile selection tab in Storage Settings
- StorageDashboardFragment and StorageItemPreferenceController works only for one profile per instance. - StorageAsyncLoader loads for all users(profiles) and regards each user independent. - SecondaryUserController will not load personal profile user in work profile tab. - Cleanup some unused profile related files. Bug: 174964885 Test: atest com.android.settings.deviceinfo atest com.android.settings.deviceinfo.storage make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage Change-Id: I8361c29bc240c519c7261b19522c41439479c1c2 Merged-In: I8361c29bc240c519c7261b19522c41439479c1c2
This commit is contained in:
@@ -63,9 +63,11 @@ public class SecondaryUserController extends AbstractPreferenceController implem
|
||||
*
|
||||
* @param context Context for initializing the preference controllers.
|
||||
* @param userManager UserManagerWrapper for figuring out which controllers to add.
|
||||
* @param isWorkProfileOnly only shows secondary users of work profile.
|
||||
* (e.g., it should be true in work profile tab)
|
||||
*/
|
||||
public static List<AbstractPreferenceController> getSecondaryUserControllers(
|
||||
Context context, UserManager userManager) {
|
||||
Context context, UserManager userManager, boolean isWorkProfileOnly) {
|
||||
|
||||
List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
UserInfo primaryUser = userManager.getPrimaryUser();
|
||||
@@ -77,7 +79,11 @@ public class SecondaryUserController extends AbstractPreferenceController implem
|
||||
continue;
|
||||
}
|
||||
|
||||
if (info == null || Utils.isProfileOf(primaryUser, info)) {
|
||||
if (Utils.isProfileOf(primaryUser, info)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isWorkProfileOnly && !info.isManagedProfile()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user