Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90d020d9 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Fix code accounting bugs, track external app data." into oc-dev

am: 4b32f7c6

Change-Id: Ie14bf66fd93d6c461983a5232d4164c815cb56b7
parents a17c58ff 4b32f7c6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6925,6 +6925,7 @@ package android.app.usage {
  public final class ExternalStorageStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getAppBytes();
    method public long getAudioBytes();
    method public long getImageBytes();
    method public long getTotalBytes();
+1 −0
Original line number Diff line number Diff line
@@ -7390,6 +7390,7 @@ package android.app.usage {
  public final class ExternalStorageStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getAppBytes();
    method public long getAudioBytes();
    method public long getImageBytes();
    method public long getTotalBytes();
+1 −0
Original line number Diff line number Diff line
@@ -6955,6 +6955,7 @@ package android.app.usage {
  public final class ExternalStorageStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getAppBytes();
    method public long getAudioBytes();
    method public long getImageBytes();
    method public long getTotalBytes();
+14 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ public final class ExternalStorageStats implements Parcelable {
    /** {@hide} */ public long audioBytes;
    /** {@hide} */ public long videoBytes;
    /** {@hide} */ public long imageBytes;
    /** {@hide} */ public long appBytes;

    /**
     * Return the total bytes used by all files in the shared/external storage
@@ -64,6 +65,17 @@ public final class ExternalStorageStats implements Parcelable {
        return imageBytes;
    }

    /**
     * Return the total bytes used by app files in the shared/external storage
     * hosted on this volume.
     * <p>
     * This data is already accounted against individual apps as returned
     * through {@link StorageStats}.
     */
    public long getAppBytes() {
        return appBytes;
    }

    /** {@hide} */
    public ExternalStorageStats() {
    }
@@ -74,6 +86,7 @@ public final class ExternalStorageStats implements Parcelable {
        this.audioBytes = in.readLong();
        this.videoBytes = in.readLong();
        this.imageBytes = in.readLong();
        this.appBytes = in.readLong();
    }

    @Override
@@ -87,6 +100,7 @@ public final class ExternalStorageStats implements Parcelable {
        dest.writeLong(audioBytes);
        dest.writeLong(videoBytes);
        dest.writeLong(imageBytes);
        dest.writeLong(appBytes);
    }

    public static final Creator<ExternalStorageStats> CREATOR = new Creator<ExternalStorageStats>() {
+15 −6
Original line number Diff line number Diff line
@@ -22,12 +22,8 @@ import android.os.Parcelable;
import android.os.UserHandle;

/**
 * Storage statistics for a UID or {@link UserHandle} on a single storage
 * volume.
 * <p class="note">
 * Note: multiple packages using the same {@code sharedUserId} in their manifest
 * will be merged into a single UID.
 * </p>
 * Storage statistics for a UID, package, or {@link UserHandle} on a single
 * storage volume.
 *
 * @see StorageStatsManager
 */
@@ -40,6 +36,9 @@ public final class StorageStats implements Parcelable {
     * Return the size of all code. This includes {@code APK} files and
     * optimized compiler output.
     * <p>
     * If the primary external/shared storage is hosted on this storage device,
     * then this includes files stored under {@link Context#getObbDir()}.
     * <p>
     * Code is shared between all users on a multiuser device.
     */
    public long getCodeBytes() {
@@ -51,6 +50,12 @@ public final class StorageStats implements Parcelable {
     * {@link Context#getDataDir()}, {@link Context#getCacheDir()},
     * {@link Context#getCodeCacheDir()}.
     * <p>
     * If the primary external/shared storage is hosted on this storage device,
     * then this includes files stored under
     * {@link Context#getExternalFilesDir(String)},
     * {@link Context#getExternalCacheDir()}, and
     * {@link Context#getExternalMediaDirs()}.
     * <p>
     * Data is isolated for each user on a multiuser device.
     */
    public long getDataBytes() {
@@ -61,6 +66,10 @@ public final class StorageStats implements Parcelable {
     * Return the size of all cached data. This includes files stored under
     * {@link Context#getCacheDir()} and {@link Context#getCodeCacheDir()}.
     * <p>
     * If the primary external/shared storage is hosted on this storage device,
     * then this includes files stored under
     * {@link Context#getExternalCacheDir()}.
     * <p>
     * Cached data is isolated for each user on a multiuser device.
     */
    public long getCacheBytes() {
Loading