Loading cmds/pm/src/com/android/commands/pm/Pm.java +3 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import android.os.ShellCallback; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.os.storage.StorageManager; import android.text.TextUtils; import android.text.format.DateUtils; import android.util.Log; Loading Loading @@ -1471,7 +1472,8 @@ public final class Pm { } ClearDataObserver obs = new ClearDataObserver(); try { mPm.freeStorageAndNotify(volumeUuid, sizeVal, obs); mPm.freeStorageAndNotify(volumeUuid, sizeVal, StorageManager.FLAG_ALLOCATE_DEFY_RESERVED, obs); synchronized (obs) { while (!obs.finished) { try { Loading core/java/android/app/ApplicationPackageManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -2112,7 +2112,7 @@ public class ApplicationPackageManager extends PackageManager { public void freeStorageAndNotify(String volumeUuid, long idealStorageSize, IPackageDataObserver observer) { try { mPM.freeStorageAndNotify(volumeUuid, idealStorageSize, observer); mPM.freeStorageAndNotify(volumeUuid, idealStorageSize, 0, observer); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2121,7 +2121,7 @@ public class ApplicationPackageManager extends PackageManager { @Override public void freeStorage(String volumeUuid, long freeStorageSize, IntentSender pi) { try { mPM.freeStorage(volumeUuid, freeStorageSize, pi); mPM.freeStorage(volumeUuid, freeStorageSize, 0, pi); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading 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); long getCacheBytes(String volumeUuid, String callingPackage); long getCacheQuotaBytes(String volumeUuid, int uid, String callingPackage); StorageStats queryStatsForPackage(String volumeUuid, String packageName, int userId, String callingPackage); StorageStats queryStatsForUid(String volumeUuid, int uid, String callingPackage); Loading core/java/android/app/usage/StorageStatsManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,24 @@ public class StorageStatsManager { return getFreeBytes(convert(uuid)); } /** {@hide} */ public @BytesLong long getCacheBytes(@NonNull UUID storageUuid) throws IOException { try { return mService.getCacheBytes(convert(storageUuid), mContext.getOpPackageName()); } catch (ParcelableException e) { e.maybeRethrow(IOException.class); throw new RuntimeException(e); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** {@hide} */ @Deprecated public long getCacheBytes(String uuid) throws IOException { return getCacheBytes(convert(uuid)); } /** * Return storage statistics for a specific package on the requested storage * volume. Loading core/java/android/content/pm/IPackageManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ interface IPackageManager { * the operation is completed */ void freeStorageAndNotify(in String volumeUuid, in long freeStorageSize, IPackageDataObserver observer); int storageFlags, IPackageDataObserver observer); /** * Free storage by deleting LRU sorted list of cache files across Loading @@ -385,7 +385,7 @@ interface IPackageManager { * to indicate that no call back is desired. */ void freeStorage(in String volumeUuid, in long freeStorageSize, in IntentSender pi); int storageFlags, in IntentSender pi); /** * Delete all the cache files in an applications cache directory Loading Loading
cmds/pm/src/com/android/commands/pm/Pm.java +3 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import android.os.ShellCallback; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.os.storage.StorageManager; import android.text.TextUtils; import android.text.format.DateUtils; import android.util.Log; Loading Loading @@ -1471,7 +1472,8 @@ public final class Pm { } ClearDataObserver obs = new ClearDataObserver(); try { mPm.freeStorageAndNotify(volumeUuid, sizeVal, obs); mPm.freeStorageAndNotify(volumeUuid, sizeVal, StorageManager.FLAG_ALLOCATE_DEFY_RESERVED, obs); synchronized (obs) { while (!obs.finished) { try { Loading
core/java/android/app/ApplicationPackageManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -2112,7 +2112,7 @@ public class ApplicationPackageManager extends PackageManager { public void freeStorageAndNotify(String volumeUuid, long idealStorageSize, IPackageDataObserver observer) { try { mPM.freeStorageAndNotify(volumeUuid, idealStorageSize, observer); mPM.freeStorageAndNotify(volumeUuid, idealStorageSize, 0, observer); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2121,7 +2121,7 @@ public class ApplicationPackageManager extends PackageManager { @Override public void freeStorage(String volumeUuid, long freeStorageSize, IntentSender pi) { try { mPM.freeStorage(volumeUuid, freeStorageSize, pi); mPM.freeStorage(volumeUuid, freeStorageSize, 0, pi); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
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); long getCacheBytes(String volumeUuid, String callingPackage); long getCacheQuotaBytes(String volumeUuid, int uid, String callingPackage); StorageStats queryStatsForPackage(String volumeUuid, String packageName, int userId, String callingPackage); StorageStats queryStatsForUid(String volumeUuid, int uid, String callingPackage); Loading
core/java/android/app/usage/StorageStatsManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,24 @@ public class StorageStatsManager { return getFreeBytes(convert(uuid)); } /** {@hide} */ public @BytesLong long getCacheBytes(@NonNull UUID storageUuid) throws IOException { try { return mService.getCacheBytes(convert(storageUuid), mContext.getOpPackageName()); } catch (ParcelableException e) { e.maybeRethrow(IOException.class); throw new RuntimeException(e); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** {@hide} */ @Deprecated public long getCacheBytes(String uuid) throws IOException { return getCacheBytes(convert(uuid)); } /** * Return storage statistics for a specific package on the requested storage * volume. Loading
core/java/android/content/pm/IPackageManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ interface IPackageManager { * the operation is completed */ void freeStorageAndNotify(in String volumeUuid, in long freeStorageSize, IPackageDataObserver observer); int storageFlags, IPackageDataObserver observer); /** * Free storage by deleting LRU sorted list of cache files across Loading @@ -385,7 +385,7 @@ interface IPackageManager { * to indicate that no call back is desired. */ void freeStorage(in String volumeUuid, in long freeStorageSize, in IntentSender pi); int storageFlags, in IntentSender pi); /** * Delete all the cache files in an applications cache directory Loading