Update the API usage to get total size of devices

StorageStatsManager fixed in StorageStatsService#getTotalBytes
So that we should change back to call the API.

Bug: 295358118
Bug: 288103116
Test: verified manually
Change-Id: I3dcc9698403612f961cf0de41925dcbcb43e260b
This commit is contained in:
Edgar Wang
2023-08-15 19:48:13 +08:00
parent 3bf2649386
commit 2d57d002ae
5 changed files with 4 additions and 24 deletions

View File

@@ -66,7 +66,6 @@ import android.os.BatteryManager;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.os.INetworkManagementService;
import android.os.RemoteException;
@@ -1354,14 +1353,4 @@ public final class Utils extends com.android.settingslib.Utils {
return dreamsSupported && (!dreamsOnlyEnabledForDockUser || canCurrentUserDream(context));
}
/**
* Get private total size directly.
* Referred from StorageManager
*/
public static long getPrimaryStorageSize() {
// TODO(b/288103116): remove this method once support by StorageManager.
return Environment.getDataDirectory().getTotalSpace()
+ Environment.getRootDirectory().getTotalSpace();
}
}