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

Commit 9d78dbc4 authored by alukin's avatar alukin
Browse files

Add getTotalBytes() to StorageStatsSource

Adding a new method to StorageStatsSource
which is just a wrapper to already existing
StorageStatsManager method.

Bug: 309801699
Test: atest StorageItemPreferenceControllerTest
Test: atest StorageCacheHelperTest
Change-Id: I860414c86081892aad6be365d7328fa92d0be436
parent be0aeae3
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.