Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6882,6 +6882,7 @@ package android.app.usage { method public long getFreeBytes(java.lang.String); method public long getTotalBytes(java.lang.String); method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForUid(java.lang.String, int); method public android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle); } api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -7304,6 +7304,7 @@ package android.app.usage { method public long getFreeBytes(java.lang.String); method public long getTotalBytes(java.lang.String); method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForUid(java.lang.String, int); method public android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle); } api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6908,6 +6908,7 @@ package android.app.usage { method public long getFreeBytes(java.lang.String); method public long getTotalBytes(java.lang.String); method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForUid(java.lang.String, int); method public android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle); } core/java/android/app/usage/IStorageStatsManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ interface IStorageStatsManager { boolean isQuotaSupported(String volumeUuid, String callingPackage); long getTotalBytes(String volumeUuid, String callingPackage); long getFreeBytes(String volumeUuid, String callingPackage); StorageStats queryStatsForPackage(String volumeUuid, String packageName, int userId, String callingPackage); StorageStats queryStatsForUid(String volumeUuid, int uid, String callingPackage); StorageStats queryStatsForUser(String volumeUuid, int userId, String callingPackage); ExternalStorageStats queryExternalStatsForUser(String volumeUuid, int userId, String callingPackage); Loading core/java/android/app/usage/StorageStatsManager.java +32 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app.usage; import android.annotation.WorkerThread; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.os.RemoteException; import android.os.UserHandle; Loading Loading @@ -99,6 +100,37 @@ public class StorageStatsManager { } } /** * Return storage statistics for a specific package on the requested storage * volume. * <p> * This method may take several seconds to calculate the requested values, * so it should only be called from a worker thread. * <p class="note"> * Note: if the requested package uses the {@code android:sharedUserId} * manifest feature, this call will be forced into a slower manual * calculation path. If possible, consider always using * {@link #queryStatsForUid(String, int)}, which is typically faster. * </p> * * @param volumeUuid the UUID of the storage volume you're interested in, or * {@code null} to specify the default internal storage. * @param packageName the package name you're interested in. * @param user the user you're interested in. * @see ApplicationInfo#volumeUuid * @see PackageInfo#packageName */ @WorkerThread public StorageStats queryStatsForPackage(String volumeUuid, String packageName, UserHandle user) { try { return mService.queryStatsForPackage(volumeUuid, packageName, user.getIdentifier(), mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Return storage statistics for a specific UID on the requested storage * volume. Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6882,6 +6882,7 @@ package android.app.usage { method public long getFreeBytes(java.lang.String); method public long getTotalBytes(java.lang.String); method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForUid(java.lang.String, int); method public android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle); }
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -7304,6 +7304,7 @@ package android.app.usage { method public long getFreeBytes(java.lang.String); method public long getTotalBytes(java.lang.String); method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForUid(java.lang.String, int); method public android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle); }
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6908,6 +6908,7 @@ package android.app.usage { method public long getFreeBytes(java.lang.String); method public long getTotalBytes(java.lang.String); method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle); method public android.app.usage.StorageStats queryStatsForUid(java.lang.String, int); method public android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle); }
core/java/android/app/usage/IStorageStatsManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ interface IStorageStatsManager { boolean isQuotaSupported(String volumeUuid, String callingPackage); long getTotalBytes(String volumeUuid, String callingPackage); long getFreeBytes(String volumeUuid, String callingPackage); StorageStats queryStatsForPackage(String volumeUuid, String packageName, int userId, String callingPackage); StorageStats queryStatsForUid(String volumeUuid, int uid, String callingPackage); StorageStats queryStatsForUser(String volumeUuid, int userId, String callingPackage); ExternalStorageStats queryExternalStatsForUser(String volumeUuid, int userId, String callingPackage); Loading
core/java/android/app/usage/StorageStatsManager.java +32 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app.usage; import android.annotation.WorkerThread; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.os.RemoteException; import android.os.UserHandle; Loading Loading @@ -99,6 +100,37 @@ public class StorageStatsManager { } } /** * Return storage statistics for a specific package on the requested storage * volume. * <p> * This method may take several seconds to calculate the requested values, * so it should only be called from a worker thread. * <p class="note"> * Note: if the requested package uses the {@code android:sharedUserId} * manifest feature, this call will be forced into a slower manual * calculation path. If possible, consider always using * {@link #queryStatsForUid(String, int)}, which is typically faster. * </p> * * @param volumeUuid the UUID of the storage volume you're interested in, or * {@code null} to specify the default internal storage. * @param packageName the package name you're interested in. * @param user the user you're interested in. * @see ApplicationInfo#volumeUuid * @see PackageInfo#packageName */ @WorkerThread public StorageStats queryStatsForPackage(String volumeUuid, String packageName, UserHandle user) { try { return mService.queryStatsForPackage(volumeUuid, packageName, user.getIdentifier(), mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Return storage statistics for a specific UID on the requested storage * volume. Loading