Search in sources :

Example 11 with StorageManagerVolumeProvider

use of com.android.settingslib.deviceinfo.StorageManagerVolumeProvider in project android_packages_apps_Settings by LineageOS.

the class StorageDashboardFragment method getPreferenceControllers.

@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    mSummaryController = new StorageSummaryDonutPreferenceController(context);
    controllers.add(mSummaryController);
    StorageManager sm = context.getSystemService(StorageManager.class);
    mPreferenceController = new StorageItemPreferenceController(context, this, mVolume, new StorageManagerVolumeProvider(sm));
    controllers.add(mPreferenceController);
    UserManagerWrapper userManager = new UserManagerWrapperImpl(context.getSystemService(UserManager.class));
    mSecondaryUsers = SecondaryUserController.getSecondaryUserControllers(context, userManager);
    controllers.addAll(mSecondaryUsers);
    final AutomaticStorageManagementSwitchPreferenceController asmController = new AutomaticStorageManagementSwitchPreferenceController(context, mMetricsFeatureProvider, getFragmentManager());
    getLifecycle().addObserver(asmController);
    controllers.add(asmController);
    return controllers;
}
Also used : AutomaticStorageManagementSwitchPreferenceController(com.android.settings.deviceinfo.storage.AutomaticStorageManagementSwitchPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) StorageItemPreferenceController(com.android.settings.deviceinfo.storage.StorageItemPreferenceController) UserManager(android.os.UserManager) ArrayList(java.util.ArrayList) StorageManager(android.os.storage.StorageManager) UserManagerWrapperImpl(com.android.settings.applications.UserManagerWrapperImpl) StorageManagerVolumeProvider(com.android.settingslib.deviceinfo.StorageManagerVolumeProvider) StorageSummaryDonutPreferenceController(com.android.settings.deviceinfo.storage.StorageSummaryDonutPreferenceController) UserManagerWrapper(com.android.settings.applications.UserManagerWrapper)

Example 12 with StorageManagerVolumeProvider

use of com.android.settingslib.deviceinfo.StorageManagerVolumeProvider in project android_packages_apps_Settings by LineageOS.

the class StorageProfileFragment method getPreferenceControllers.

@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final StorageManager sm = context.getSystemService(StorageManager.class);
    mPreferenceController = new StorageItemPreferenceController(context, this, mVolume, new StorageManagerVolumeProvider(sm), /* isWorkProfile */
    true);
    controllers.add(mPreferenceController);
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) StorageItemPreferenceController(com.android.settings.deviceinfo.storage.StorageItemPreferenceController) ArrayList(java.util.ArrayList) StorageManager(android.os.storage.StorageManager) StorageManagerVolumeProvider(com.android.settingslib.deviceinfo.StorageManagerVolumeProvider)

Example 13 with StorageManagerVolumeProvider

use of com.android.settingslib.deviceinfo.StorageManagerVolumeProvider in project android_packages_apps_Settings by omnirom.

the class StorageProfileFragment method getPreferenceControllers.

@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final StorageManager sm = context.getSystemService(StorageManager.class);
    mPreferenceController = new StorageItemPreferenceController(context, this, mVolume, new StorageManagerVolumeProvider(sm), /* isWorkProfile */
    true);
    controllers.add(mPreferenceController);
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) StorageItemPreferenceController(com.android.settings.deviceinfo.storage.StorageItemPreferenceController) ArrayList(java.util.ArrayList) StorageManager(android.os.storage.StorageManager) StorageManagerVolumeProvider(com.android.settingslib.deviceinfo.StorageManagerVolumeProvider)

Example 14 with StorageManagerVolumeProvider

use of com.android.settingslib.deviceinfo.StorageManagerVolumeProvider in project android_packages_apps_Settings by crdroidandroid.

the class StorageDashboardFragment method getPreferenceControllers.

@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    mSummaryController = new StorageSummaryDonutPreferenceController(context);
    controllers.add(mSummaryController);
    StorageManager sm = context.getSystemService(StorageManager.class);
    mPreferenceController = new StorageItemPreferenceController(context, this, mVolume, new StorageManagerVolumeProvider(sm));
    controllers.add(mPreferenceController);
    UserManagerWrapper userManager = new UserManagerWrapperImpl(context.getSystemService(UserManager.class));
    mSecondaryUsers = SecondaryUserController.getSecondaryUserControllers(context, userManager);
    controllers.addAll(mSecondaryUsers);
    final AutomaticStorageManagementSwitchPreferenceController asmController = new AutomaticStorageManagementSwitchPreferenceController(context, mMetricsFeatureProvider, getFragmentManager());
    getLifecycle().addObserver(asmController);
    controllers.add(asmController);
    return controllers;
}
Also used : AutomaticStorageManagementSwitchPreferenceController(com.android.settings.deviceinfo.storage.AutomaticStorageManagementSwitchPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) StorageItemPreferenceController(com.android.settings.deviceinfo.storage.StorageItemPreferenceController) UserManager(android.os.UserManager) ArrayList(java.util.ArrayList) StorageManager(android.os.storage.StorageManager) UserManagerWrapperImpl(com.android.settings.applications.UserManagerWrapperImpl) StorageManagerVolumeProvider(com.android.settingslib.deviceinfo.StorageManagerVolumeProvider) StorageSummaryDonutPreferenceController(com.android.settings.deviceinfo.storage.StorageSummaryDonutPreferenceController) UserManagerWrapper(com.android.settings.applications.UserManagerWrapper)

Example 15 with StorageManagerVolumeProvider

use of com.android.settingslib.deviceinfo.StorageManagerVolumeProvider in project android_packages_apps_Settings by crdroidandroid.

the class StorageProfileFragment method getPreferenceControllers.

@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final StorageManager sm = context.getSystemService(StorageManager.class);
    mPreferenceController = new StorageItemPreferenceController(context, this, mVolume, new StorageManagerVolumeProvider(sm), /* isWorkProfile */
    true);
    controllers.add(mPreferenceController);
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) StorageItemPreferenceController(com.android.settings.deviceinfo.storage.StorageItemPreferenceController) ArrayList(java.util.ArrayList) StorageManager(android.os.storage.StorageManager) StorageManagerVolumeProvider(com.android.settingslib.deviceinfo.StorageManagerVolumeProvider)

Aggregations

StorageManagerVolumeProvider (com.android.settingslib.deviceinfo.StorageManagerVolumeProvider)20 StorageManager (android.os.storage.StorageManager)17 StorageItemPreferenceController (com.android.settings.deviceinfo.storage.StorageItemPreferenceController)16 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)16 ArrayList (java.util.ArrayList)16 UserManager (android.os.UserManager)7 StorageSummaryDonutPreferenceController (com.android.settings.deviceinfo.storage.StorageSummaryDonutPreferenceController)7 UserManagerWrapper (com.android.settings.applications.UserManagerWrapper)6 UserManagerWrapperImpl (com.android.settings.applications.UserManagerWrapperImpl)6 AutomaticStorageManagementSwitchPreferenceController (com.android.settings.deviceinfo.storage.AutomaticStorageManagementSwitchPreferenceController)6 PrivateStorageInfo (com.android.settingslib.deviceinfo.PrivateStorageInfo)3 IconCompat (androidx.core.graphics.drawable.IconCompat)2 ListBuilder (androidx.slice.builders.ListBuilder)2 Context (android.content.Context)1 Bundle (android.os.Bundle)1 DiskInfo (android.os.storage.DiskInfo)1 VolumeInfo (android.os.storage.VolumeInfo)1 VolumeRecord (android.os.storage.VolumeRecord)1 BytesResult (android.text.format.Formatter.BytesResult)1 Preference (androidx.preference.Preference)1