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

Commit a6cf9c11 authored by Aleksandr Lukin's avatar Aleksandr Lukin Committed by Android (Google) Code Review
Browse files

Merge "Add getTotalBytes() to StorageStatsSource" into main

parents 9a81bc64 9d78dbc4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settingslib.applications;

import android.annotation.NonNull;
import android.app.usage.StorageStats;
import android.app.usage.StorageStatsManager;
import android.content.Context;
@@ -25,6 +26,7 @@ import android.os.UserHandle;
import androidx.annotation.VisibleForTesting;

import java.io.IOException;
import java.util.UUID;

/**
 * StorageStatsSource wraps the StorageStatsManager for testability purposes.
@@ -59,6 +61,10 @@ public class StorageStatsSource {
        return mStorageStatsManager.getCacheQuotaBytes(volumeUuid, uid);
    }

    public long getTotalBytes(@NonNull UUID storageUuid) throws IOException {
        return mStorageStatsManager.getTotalBytes(storageUuid);
    }

    /**
     * Static class that provides methods for querying the amount of external storage available as
     * well as breaking it up into several media types.