summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-01-17 11:58:02 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-17 11:58:02 -0800
commitd37d661669cc019faa93177aee9c6143eebe490f (patch)
treed98034179f017ab2eac4938c04bc5ce7ff74e82d
parentbee8ec2538c75797d9704617411f831945c8da54 (diff)
parentbcd6c96e753d2efc76f918c403cecbfdbd4f037a (diff)
downloadframeworks_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.xml40
-rw-r--r--api/current.xml21
-rwxr-xr-xcore/java/android/content/pm/PackageStats.java8
-rw-r--r--services/java/com/android/server/PackageManagerService.java5
4 files changed, 74 insertions, 0 deletions
diff --git a/api/11.xml b/api/11.xml
index 5b6765b..d59d80a 100644
--- a/api/11.xml
+++ b/api/11.xml
@@ -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());
}
}