FileDocCategorySizeDatePackage
PackageStats.javaAPI DocAndroid 5.1 API5425Thu Mar 12 22:22:10 GMT 2015android.content.pm

PackageStats

public class PackageStats extends Object implements android.os.Parcelable
implementation of PackageStats associated with a application package.

Fields Summary
public String
packageName
Name of the package to which this stats applies.
public int
userHandle
public long
codeSize
Size of the code (e.g., APK)
public long
dataSize
Size of the internal data size for the application. (e.g., /data/data/)
public long
cacheSize
Size of cache used by the application. (e.g., /data/data//cache)
public long
externalCodeSize
Size of the secure container on external storage holding the application's code.
public long
externalDataSize
Size of the external data used by the application (e.g., /Android/data/)
public long
externalCacheSize
Size of the external cache used by the application (i.e., on the SD card). If this is a subdirectory of the data directory, this size will be subtracted out of the external data size.
public long
externalMediaSize
Size of the external media size used by the application.
public long
externalObbSize
Size of the package's OBBs placed on external media.
public static final Parcelable.Creator
CREATOR
Constructors Summary
public PackageStats(String pkgName)

        packageName = pkgName;
        userHandle = UserHandle.myUserId();
    
public PackageStats(String pkgName, int userHandle)

hide

        this.packageName = pkgName;
        this.userHandle = userHandle;
    
public PackageStats(android.os.Parcel source)

        packageName = source.readString();
        userHandle = source.readInt();
        codeSize = source.readLong();
        dataSize = source.readLong();
        cacheSize = source.readLong();
        externalCodeSize = source.readLong();
        externalDataSize = source.readLong();
        externalCacheSize = source.readLong();
        externalMediaSize = source.readLong();
        externalObbSize = source.readLong();
    
public PackageStats(PackageStats pStats)

        packageName = pStats.packageName;
        userHandle = pStats.userHandle;
        codeSize = pStats.codeSize;
        dataSize = pStats.dataSize;
        cacheSize = pStats.cacheSize;
        externalCodeSize = pStats.externalCodeSize;
        externalDataSize = pStats.externalDataSize;
        externalCacheSize = pStats.externalCacheSize;
        externalMediaSize = pStats.externalMediaSize;
        externalObbSize = pStats.externalObbSize;
    
Methods Summary
public intdescribeContents()

        return 0;
    
public java.lang.StringtoString()


       
        final StringBuilder sb = new StringBuilder("PackageStats{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append(" ");
        sb.append(packageName);
        if (codeSize != 0) {
            sb.append(" code=");
            sb.append(codeSize);
        }
        if (dataSize != 0) {
            sb.append(" data=");
            sb.append(dataSize);
        }
        if (cacheSize != 0) {
            sb.append(" cache=");
            sb.append(cacheSize);
        }
        if (externalCodeSize != 0) {
            sb.append(" extCode=");
            sb.append(externalCodeSize);
        }
        if (externalDataSize != 0) {
            sb.append(" extData=");
            sb.append(externalDataSize);
        }
        if (externalCacheSize != 0) {
            sb.append(" extCache=");
            sb.append(externalCacheSize);
        }
        if (externalMediaSize != 0) {
            sb.append(" media=");
            sb.append(externalMediaSize);
        }
        if (externalObbSize != 0) {
            sb.append(" obb=");
            sb.append(externalObbSize);
        }
        sb.append("}");
        return sb.toString();
    
public voidwriteToParcel(android.os.Parcel dest, int parcelableFlags)

        dest.writeString(packageName);
        dest.writeInt(userHandle);
        dest.writeLong(codeSize);
        dest.writeLong(dataSize);
        dest.writeLong(cacheSize);
        dest.writeLong(externalCodeSize);
        dest.writeLong(externalDataSize);
        dest.writeLong(externalCacheSize);
        dest.writeLong(externalMediaSize);
        dest.writeLong(externalObbSize);