diff options
author | Kenny Root <kroot@google.com> | 2010-08-19 09:11:31 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-19 09:11:31 -0700 |
commit | 821afa9aec8d3a4ffd2e72ce797d8097eaf13973 (patch) | |
tree | 5077b84763a04e978d20f74f72c9a9c0fc1609f9 /core | |
parent | 6bcffcd2dc410db780c152c70a01b22da6ca58be (diff) | |
parent | 54d41379357d1d800d0a7bd7c5dc56111710482a (diff) | |
download | frameworks_base-821afa9aec8d3a4ffd2e72ce797d8097eaf13973.zip frameworks_base-821afa9aec8d3a4ffd2e72ce797d8097eaf13973.tar.gz frameworks_base-821afa9aec8d3a4ffd2e72ce797d8097eaf13973.tar.bz2 |
am 54d41379: Merge "Add OBB flags to support overlays" into gingerbread
Merge commit '54d41379357d1d800d0a7bd7c5dc56111710482a' into gingerbread-plus-aosp
* commit '54d41379357d1d800d0a7bd7c5dc56111710482a':
Add OBB flags to support overlays
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/content/res/ObbInfo.java | 24 | ||||
-rw-r--r-- | core/java/android/os/storage/StorageManager.java | 4 | ||||
-rw-r--r-- | core/jni/android_content_res_ObbScanner.cpp | 3 |
3 files changed, 28 insertions, 3 deletions
diff --git a/core/java/android/content/res/ObbInfo.java b/core/java/android/content/res/ObbInfo.java index b18d784..838c5ff 100644 --- a/core/java/android/content/res/ObbInfo.java +++ b/core/java/android/content/res/ObbInfo.java @@ -25,6 +25,9 @@ import android.os.Parcelable; * @hide */ public class ObbInfo implements Parcelable { + /** Flag noting that this OBB is an overlay patch for a base OBB. */ + public static final int OBB_OVERLAY = 1 << 0; + /** * The name of the package to which the OBB file belongs. */ @@ -35,13 +38,26 @@ public class ObbInfo implements Parcelable { */ public int version; + /** + * The flags relating to the OBB. + */ + public int flags; + public ObbInfo() { } public String toString() { - return "ObbInfo{" - + Integer.toHexString(System.identityHashCode(this)) - + " packageName=" + packageName + ",version=" + version + "}"; + StringBuilder sb = new StringBuilder(); + sb.append("ObbInfo{"); + sb.append(Integer.toHexString(System.identityHashCode(this))); + sb.append(" packageName="); + sb.append(packageName); + sb.append(",version="); + sb.append(version); + sb.append(",flags="); + sb.append(flags); + sb.append('}'); + return sb.toString(); } public int describeContents() { @@ -51,6 +67,7 @@ public class ObbInfo implements Parcelable { public void writeToParcel(Parcel dest, int parcelableFlags) { dest.writeString(packageName); dest.writeInt(version); + dest.writeInt(flags); } public static final Parcelable.Creator<ObbInfo> CREATOR @@ -67,5 +84,6 @@ public class ObbInfo implements Parcelable { private ObbInfo(Parcel source) { packageName = source.readString(); version = source.readInt(); + flags = source.readInt(); } } diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index cb1794f..df0b69c 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -304,6 +304,8 @@ public class StorageManager * file matches a package ID that is owned by the calling program's UID. * That is, shared UID applications can obtain access to any other * application's OBB that shares its UID. + * <p> + * STOPSHIP document more; discuss lack of guarantees of security * * @param filename the path to the OBB file * @param key decryption key @@ -328,6 +330,8 @@ public class StorageManager * file matches a package ID that is owned by the calling program's UID. * That is, shared UID applications can obtain access to any other * application's OBB that shares its UID. + * <p> + * STOPSHIP document more; discuss lack of guarantees of security * * @param filename path to the OBB file * @param force whether to kill any programs using this in order to unmount diff --git a/core/jni/android_content_res_ObbScanner.cpp b/core/jni/android_content_res_ObbScanner.cpp index 1239274..62c89fc 100644 --- a/core/jni/android_content_res_ObbScanner.cpp +++ b/core/jni/android_content_res_ObbScanner.cpp @@ -31,6 +31,7 @@ static struct { jfieldID packageName; jfieldID version; + jfieldID flags; } gObbInfoClassInfo; static jboolean android_content_res_ObbScanner_getObbInfo(JNIEnv* env, jobject clazz, jstring file, @@ -85,6 +86,8 @@ int register_android_content_res_ObbScanner(JNIEnv* env) "packageName", "Ljava/lang/String;"); GET_FIELD_ID(gObbInfoClassInfo.version, gObbInfoClassInfo.clazz, "version", "I"); + GET_FIELD_ID(gObbInfoClassInfo.flags, gObbInfoClassInfo.clazz, + "flags", "I"); return AndroidRuntime::registerNativeMethods(env, "android/content/res/ObbScanner", gMethods, NELEM(gMethods)); |