Remove more wrappers

- WallpaperManagerWrapper
- UserManagerWrapper

Bug: 76167422
Test: robotests
Change-Id: I3ca866089082e01f1e9d7a4554387962f45a5437
This commit is contained in:
Fan Zhang
2018-04-02 11:33:16 -07:00
parent e1549f0af1
commit 947a673f74
16 changed files with 113 additions and 200 deletions

View File

@@ -47,7 +47,6 @@ import com.android.settings.deviceinfo.storage.VolumeSizesLoader;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settings.widget.EntityHeaderController;
import com.android.settings.wrapper.UserManagerWrapper;
import com.android.settingslib.applications.StorageStatsSource;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.deviceinfo.PrivateStorageInfo;
@@ -185,8 +184,7 @@ public class StorageDashboardFragment extends DashboardFragment
mVolume, new StorageManagerVolumeProvider(sm));
controllers.add(mPreferenceController);
UserManagerWrapper userManager =
new UserManagerWrapper(context.getSystemService(UserManager.class));
final UserManager userManager = context.getSystemService(UserManager.class);
mSecondaryUsers = SecondaryUserController.getSecondaryUserControllers(context, userManager);
controllers.addAll(mSecondaryUsers);
@@ -235,8 +233,7 @@ public class StorageDashboardFragment extends DashboardFragment
public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
final StorageManager sm = context.getSystemService(StorageManager.class);
final UserManagerWrapper userManager =
new UserManagerWrapper(context.getSystemService(UserManager.class));
final UserManager userManager = context.getSystemService(UserManager.class);
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new StorageSummaryDonutPreferenceController(context));
controllers.add(new StorageItemPreferenceController(context, null /* host */,
@@ -251,9 +248,8 @@ public class StorageDashboardFragment extends DashboardFragment
@Override
public Loader<SparseArray<StorageAsyncLoader.AppsStorageResult>> onCreateLoader(int id,
Bundle args) {
Context context = getContext();
return new StorageAsyncLoader(context,
new UserManagerWrapper(context.getSystemService(UserManager.class)),
final Context context = getContext();
return new StorageAsyncLoader(context, context.getSystemService(UserManager.class),
mVolume.fsUuid,
new StorageStatsSource(context),
new PackageManagerWrapper(context.getPackageManager()));