Loading core/java/android/app/usage/ExternalStorageStats.java +8 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ public final class ExternalStorageStats implements Parcelable { /** {@hide} */ public long videoBytes; /** {@hide} */ public long imageBytes; /** {@hide} */ public long appBytes; /** {@hide} */ public long obbBytes; /** * Return the total bytes used by all files in the shared/external storage Loading Loading @@ -96,6 +97,11 @@ public final class ExternalStorageStats implements Parcelable { return appBytes; } /** {@hide} */ public @BytesLong long getObbBytes() { return obbBytes; } /** {@hide} */ public ExternalStorageStats() { } Loading @@ -107,6 +113,7 @@ public final class ExternalStorageStats implements Parcelable { this.videoBytes = in.readLong(); this.imageBytes = in.readLong(); this.appBytes = in.readLong(); this.obbBytes = in.readLong(); } @Override Loading @@ -121,6 +128,7 @@ public final class ExternalStorageStats implements Parcelable { dest.writeLong(videoBytes); dest.writeLong(imageBytes); dest.writeLong(appBytes); dest.writeLong(obbBytes); } public static final Creator<ExternalStorageStats> CREATOR = new Creator<ExternalStorageStats>() { Loading core/java/com/android/internal/app/IMediaContainerService.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -27,9 +27,6 @@ interface IMediaContainerService { PackageInfoLite getMinimalPackageInfo(String packagePath, int flags, String abiOverride); ObbInfo getObbInfo(String filename); long calculateDirectorySize(String directory); /** Return file system stats: [0] is total bytes, [1] is available bytes */ long[] getFileSystemStats(String path); void clearDirectory(String directory); long calculateInstalledSize(String packagePath, boolean isForwardLocked, String abiOverride); } packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +0 −21 Original line number Diff line number Diff line Loading @@ -212,27 +212,6 @@ public class DefaultContainerService extends IntentService { } } @Override public long calculateDirectorySize(String path) throws RemoteException { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); final File dir = Environment.maybeTranslateEmulatedPathToInternal(new File(path)); if (dir.exists() && dir.isDirectory()) { final String targetPath = dir.getAbsolutePath(); return MeasurementUtils.measureDirectory(targetPath); } else { return 0L; } } @Override public long[] getFileSystemStats(String path) { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); final File file = new File(path); return new long[] { file.getTotalSpace(), file.getUsableSpace() }; } @Override public void clearDirectory(String path) throws RemoteException { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); Loading services/core/java/com/android/server/pm/Installer.java +1 −1 Original line number Diff line number Diff line Loading @@ -258,7 +258,7 @@ public class Installer extends SystemService { public long[] getExternalSize(String uuid, int userId, int flags, int[] appIds) throws InstallerException { if (!checkBeforeRemote()) return new long[4]; if (!checkBeforeRemote()) return new long[6]; try { return mInstalld.getExternalSize(uuid, userId, flags, appIds); } catch (Exception e) { Loading services/usage/java/com/android/server/usage/StorageStatsService.java +1 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub { res.videoBytes = stats[2]; res.imageBytes = stats[3]; res.appBytes = stats[4]; res.obbBytes = stats[5]; return res; } Loading Loading
core/java/android/app/usage/ExternalStorageStats.java +8 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ public final class ExternalStorageStats implements Parcelable { /** {@hide} */ public long videoBytes; /** {@hide} */ public long imageBytes; /** {@hide} */ public long appBytes; /** {@hide} */ public long obbBytes; /** * Return the total bytes used by all files in the shared/external storage Loading Loading @@ -96,6 +97,11 @@ public final class ExternalStorageStats implements Parcelable { return appBytes; } /** {@hide} */ public @BytesLong long getObbBytes() { return obbBytes; } /** {@hide} */ public ExternalStorageStats() { } Loading @@ -107,6 +113,7 @@ public final class ExternalStorageStats implements Parcelable { this.videoBytes = in.readLong(); this.imageBytes = in.readLong(); this.appBytes = in.readLong(); this.obbBytes = in.readLong(); } @Override Loading @@ -121,6 +128,7 @@ public final class ExternalStorageStats implements Parcelable { dest.writeLong(videoBytes); dest.writeLong(imageBytes); dest.writeLong(appBytes); dest.writeLong(obbBytes); } public static final Creator<ExternalStorageStats> CREATOR = new Creator<ExternalStorageStats>() { Loading
core/java/com/android/internal/app/IMediaContainerService.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -27,9 +27,6 @@ interface IMediaContainerService { PackageInfoLite getMinimalPackageInfo(String packagePath, int flags, String abiOverride); ObbInfo getObbInfo(String filename); long calculateDirectorySize(String directory); /** Return file system stats: [0] is total bytes, [1] is available bytes */ long[] getFileSystemStats(String path); void clearDirectory(String directory); long calculateInstalledSize(String packagePath, boolean isForwardLocked, String abiOverride); }
packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +0 −21 Original line number Diff line number Diff line Loading @@ -212,27 +212,6 @@ public class DefaultContainerService extends IntentService { } } @Override public long calculateDirectorySize(String path) throws RemoteException { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); final File dir = Environment.maybeTranslateEmulatedPathToInternal(new File(path)); if (dir.exists() && dir.isDirectory()) { final String targetPath = dir.getAbsolutePath(); return MeasurementUtils.measureDirectory(targetPath); } else { return 0L; } } @Override public long[] getFileSystemStats(String path) { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); final File file = new File(path); return new long[] { file.getTotalSpace(), file.getUsableSpace() }; } @Override public void clearDirectory(String path) throws RemoteException { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); Loading
services/core/java/com/android/server/pm/Installer.java +1 −1 Original line number Diff line number Diff line Loading @@ -258,7 +258,7 @@ public class Installer extends SystemService { public long[] getExternalSize(String uuid, int userId, int flags, int[] appIds) throws InstallerException { if (!checkBeforeRemote()) return new long[4]; if (!checkBeforeRemote()) return new long[6]; try { return mInstalld.getExternalSize(uuid, userId, flags, appIds); } catch (Exception e) { Loading
services/usage/java/com/android/server/usage/StorageStatsService.java +1 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub { res.videoBytes = stats[2]; res.imageBytes = stats[3]; res.appBytes = stats[4]; res.obbBytes = stats[5]; return res; } Loading