diff options
author | Kenny Root <kroot@google.com> | 2011-01-17 11:58:02 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-17 11:58:02 -0800 |
commit | d37d661669cc019faa93177aee9c6143eebe490f (patch) | |
tree | d98034179f017ab2eac4938c04bc5ce7ff74e82d | |
parent | bee8ec2538c75797d9704617411f831945c8da54 (diff) | |
parent | bcd6c96e753d2efc76f918c403cecbfdbd4f037a (diff) | |
download | frameworks_base-d37d661669cc019faa93177aee9c6143eebe490f.zip frameworks_base-d37d661669cc019faa93177aee9c6143eebe490f.tar.gz frameworks_base-d37d661669cc019faa93177aee9c6143eebe490f.tar.bz2 |
Merge "Add OBB size to PackageStats" into honeycomb
-rw-r--r-- | api/11.xml | 40 | ||||
-rw-r--r-- | api/current.xml | 21 | ||||
-rwxr-xr-x | core/java/android/content/pm/PackageStats.java | 8 | ||||
-rw-r--r-- | services/java/com/android/server/PackageManagerService.java | 5 |
4 files changed, 74 insertions, 0 deletions
@@ -61562,6 +61562,46 @@ visibility="public" > </field> +<field name="externalCacheSize" + type="long" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="externalDataSize" + type="long" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="externalMediaSize" + type="long" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="externalObbSize" + type="long" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="packageName" type="java.lang.String" transient="false" diff --git a/api/current.xml b/api/current.xml index ef23af2..b9ebd1c 100644 --- a/api/current.xml +++ b/api/current.xml @@ -61592,6 +61592,16 @@ visibility="public" > </field> +<field name="externalObbSize" + type="long" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="packageName" type="java.lang.String" transient="false" @@ -183903,6 +183913,17 @@ visibility="public" > </method> +<method name="getObbDir" + return="java.io.File" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="getPackageCodePath" return="java.lang.String" abstract="false" diff --git a/core/java/android/content/pm/PackageStats.java b/core/java/android/content/pm/PackageStats.java index 28a2886..11068e5 100755 --- a/core/java/android/content/pm/PackageStats.java +++ b/core/java/android/content/pm/PackageStats.java @@ -55,6 +55,9 @@ public class PackageStats implements Parcelable { /** Size of the external media size used by the application. */ public long externalMediaSize; + /** Size of the package's OBBs placed on external media. */ + public long externalObbSize; + public static final Parcelable.Creator<PackageStats> CREATOR = new Parcelable.Creator<PackageStats>() { public PackageStats createFromParcel(Parcel in) { @@ -83,6 +86,8 @@ public class PackageStats implements Parcelable { sb.append(externalCacheSize); sb.append(",externalMediaSize="); sb.append(externalMediaSize); + sb.append(",externalObbSize="); + sb.append(externalObbSize); return sb.toString(); } @@ -98,6 +103,7 @@ public class PackageStats implements Parcelable { externalDataSize = source.readLong(); externalCacheSize = source.readLong(); externalMediaSize = source.readLong(); + externalObbSize = source.readLong(); } public PackageStats(PackageStats pStats) { @@ -108,6 +114,7 @@ public class PackageStats implements Parcelable { externalDataSize = pStats.externalDataSize; externalCacheSize = pStats.externalCacheSize; externalMediaSize = pStats.externalMediaSize; + externalObbSize = pStats.externalObbSize; } public int describeContents() { @@ -122,5 +129,6 @@ public class PackageStats implements Parcelable { dest.writeLong(externalDataSize); dest.writeLong(externalCacheSize); dest.writeLong(externalMediaSize); + dest.writeLong(externalObbSize); } } diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 19667d4..d2c6475 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -4853,6 +4853,11 @@ class PackageManagerService extends IPackageManager.Stub { .getExternalStorageAppMediaDirectory(mStats.packageName); mStats.externalMediaSize = mContainerService .calculateDirectorySize(externalCacheDir.getPath()); + + final File externalObbDir = Environment + .getExternalStorageAppObbDirectory(mStats.packageName); + mStats.externalObbSize = mContainerService.calculateDirectorySize(externalObbDir + .getPath()); } } |