Add OBB flags to support overlays
* Add flags field in OBB footer to support overlays. * Remove unused 'crypto' and 'filesystem' fields in obbtool (could later be supported in the "flags" field of the OBB footer). * Add notes to document OBB classes before shipping. Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user