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:
@@ -20,6 +20,7 @@ import android.util.ArrayMap;
|
||||
|
||||
import com.android.settings.accounts.AccountDashboardFragment;
|
||||
import com.android.settings.applications.manageapplications.ManageApplications;
|
||||
import com.android.settings.deviceinfo.StorageDashboardFragment;
|
||||
import com.android.settings.location.LocationServices;
|
||||
import com.android.settings.location.RecentLocationAccessSeeAllFragment;
|
||||
|
||||
@@ -46,5 +47,7 @@ public class ProfileFragmentBridge {
|
||||
ProfileSelectRecentLocationAccessFragment.class.getName());
|
||||
FRAGMENT_MAP.put(LocationServices.class.getName(),
|
||||
ProfileSelectLocationServicesFragment.class.getName());
|
||||
FRAGMENT_MAP.put(StorageDashboardFragment.class.getName(),
|
||||
ProfileSelectStorageFragment.class.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.dashboard.profileselector;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.deviceinfo.StorageDashboardFragment;
|
||||
|
||||
/**
|
||||
* Storage Settings page for personal/managed profile.
|
||||
*/
|
||||
public class ProfileSelectStorageFragment extends ProfileSelectFragment {
|
||||
|
||||
@Override
|
||||
public Fragment[] getFragments() {
|
||||
final Bundle workBundle = new Bundle();
|
||||
workBundle.putInt(EXTRA_PROFILE, ProfileType.WORK);
|
||||
final Fragment workFragment = new StorageDashboardFragment();
|
||||
workFragment.setArguments(workBundle);
|
||||
|
||||
final Bundle personalBundle = new Bundle();
|
||||
personalBundle.putInt(EXTRA_PROFILE, ProfileType.PERSONAL);
|
||||
final Fragment personalFragment = new StorageDashboardFragment();
|
||||
personalFragment.setArguments(personalBundle);
|
||||
|
||||
return new Fragment[] {
|
||||
personalFragment,
|
||||
workFragment
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user