Add storage_summary_donut above ProfileSelectStorageFragment
- Modify ProfileSelectFragment to support add preference xml in the top, and tabLayout below the preferences. Base preference layout is dummy_preference_screen.xml which contains no preference. ProfileSelectStorageFragment contains StorageSummaryDonutPreference above the tabLayout. - Make StorageSummaryDonutPreferenceController self workable without StorageDashboardFragment dependence. - Rename inactive_apps.xml to dummy_preference_screen.xml - Move ShadowPrivateStorageInfo from LowStorageSliceTest Bug: 141601408 Test: manual Change-Id: Ide12840dc81bb104f328e230ecda5d35bba01d7a
This commit is contained in:
@@ -21,9 +21,6 @@ import static android.content.Intent.EXTRA_USER_ID;
|
||||
import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
|
||||
import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
|
||||
|
||||
import static com.android.settings.applications.manageapplications.ManageApplications.EXTRA_PERSONAL_ONLY;
|
||||
import static com.android.settings.applications.manageapplications.ManageApplications.EXTRA_WORK_ONLY;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
@@ -106,6 +103,7 @@ import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.profileselector.ProfileFragmentBridge;
|
||||
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
|
||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||
import com.android.settingslib.widget.ActionBarShadowController;
|
||||
|
||||
@@ -1061,12 +1059,14 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
*/
|
||||
public static Fragment getTargetFragment(Activity activity, String fragmentName, Bundle args) {
|
||||
Fragment f = null;
|
||||
final boolean isWorkOnly = args == null ? false : args.getBoolean(EXTRA_WORK_ONLY);
|
||||
final boolean isPersonalOnly = args == null ? false : args.getBoolean(EXTRA_PERSONAL_ONLY);
|
||||
final boolean isPersonal = args != null ? args.getInt(ProfileSelectFragment.EXTRA_PROFILE)
|
||||
== ProfileSelectFragment.PERSONAL : false;
|
||||
final boolean isWork = args != null ? args.getInt(ProfileSelectFragment.EXTRA_PROFILE)
|
||||
== ProfileSelectFragment.WORK : false;
|
||||
if (FeatureFlagUtils.isEnabled(activity, FeatureFlags.PERSONAL_WORK_PROFILE)
|
||||
&& UserManager.get(activity).getUserProfiles().size() > 1
|
||||
&& ProfileFragmentBridge.FRAGMENT_MAP.get(fragmentName) != null
|
||||
&& !isWorkOnly && !isPersonalOnly) {
|
||||
&& !isWork && !isPersonal) {
|
||||
f = Fragment.instantiate(activity, ProfileFragmentBridge.FRAGMENT_MAP.get(fragmentName),
|
||||
args);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user