Move lagging users over to new storage API.

Over the last month we've been moving everyone over to the new
StorageStatsManager public APIs, but we missed these users.

The ApplicationsState changes are straightforward, but we had to
completely rewrite StorageMeasurement to use the new fast-path
quota APIs.

Test: builds, boots, UI using StorageMeasurement works.
Bug: 36056120
Change-Id: If02177c95bf8c96ae4eceac4d631a168f99bef84
This commit is contained in:
Jeff Sharkey
2017-03-08 13:57:15 -07:00
parent ed8b4c7a09
commit 60f95aa00a
7 changed files with 130 additions and 364 deletions

View File

@@ -34,6 +34,7 @@ import android.annotation.XmlRes;
import android.app.PackageDeleteObserver;
import android.app.PackageInstallObserver;
import android.app.admin.DevicePolicyManager;
import android.app.usage.StorageStatsManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -5466,8 +5467,10 @@ public abstract class PackageManager {
* the status of the operation. observer may be null to indicate that
* no callback is desired.
*
* @deprecated use {@link StorageStatsManager} instead.
* @hide
*/
@Deprecated
public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId,
IPackageStatsObserver observer);
@@ -5475,8 +5478,10 @@ public abstract class PackageManager {
* Like {@link #getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)}, but
* returns the size for the calling user.
*
* @deprecated use {@link StorageStatsManager} instead.
* @hide
*/
@Deprecated
public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) {
getPackageSizeInfoAsUser(packageName, UserHandle.myUserId(), observer);
}

View File

@@ -16,6 +16,7 @@
package android.content.pm;
import android.app.usage.StorageStatsManager;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.UserHandle;
@@ -24,9 +25,13 @@ import android.text.TextUtils;
import java.util.Objects;
/**
* implementation of PackageStats associated with a
* application package.
* implementation of PackageStats associated with a application package.
*
* @deprecated this class is an orphan that could never be obtained from a valid
* public API. If you need package storage statistics use the new
* {@link StorageStatsManager} APIs.
*/
@Deprecated
public class PackageStats implements Parcelable {
/** Name of the package to which this stats applies. */
public String packageName;