diff options
author | Kenny Root <kroot@google.com> | 2010-08-12 07:36:02 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2010-08-18 09:34:58 -0700 |
commit | 02ca31fbae9f35dd30f79de6927fae11b549391a (patch) | |
tree | dc037f02f42db20ba1f086e707fd53a71ea4c4c5 /include/utils/ObbFile.h | |
parent | baf3869b88ab4e31f792dbe08f61725bc3619ea8 (diff) | |
download | frameworks_base-02ca31fbae9f35dd30f79de6927fae11b549391a.zip frameworks_base-02ca31fbae9f35dd30f79de6927fae11b549391a.tar.gz frameworks_base-02ca31fbae9f35dd30f79de6927fae11b549391a.tar.bz2 |
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
Diffstat (limited to 'include/utils/ObbFile.h')
-rw-r--r-- | include/utils/ObbFile.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/include/utils/ObbFile.h b/include/utils/ObbFile.h index d2ca82e..5243f50 100644 --- a/include/utils/ObbFile.h +++ b/include/utils/ObbFile.h @@ -18,12 +18,16 @@ #define OBBFILE_H_ #include <stdint.h> +#include <strings.h> #include <utils/RefBase.h> #include <utils/String8.h> namespace android { +// OBB flags (bit 0) +#define OBB_OVERLAY (1 << 0) + class ObbFile : public RefBase { protected: virtual ~ObbFile(); @@ -46,18 +50,38 @@ public: return mPackageName; } - int32_t getVersion() const { - return mVersion; - } - void setPackageName(String8 packageName) { mPackageName = packageName; } + int32_t getVersion() const { + return mVersion; + } + void setVersion(int32_t version) { mVersion = version; } + int32_t getFlags() const { + return mFlags; + } + + void setFlags(int32_t flags) { + mFlags = flags; + } + + bool isOverlay() { + return (mFlags & OBB_OVERLAY) == OBB_OVERLAY; + } + + void setOverlay(bool overlay) { + if (overlay) { + mFlags |= OBB_OVERLAY; + } else { + mFlags &= ~OBB_OVERLAY; + } + } + static inline uint32_t get4LE(const unsigned char* buf) { return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); } @@ -76,6 +100,9 @@ private: /* Package version this ObbFile is associated with */ int32_t mVersion; + /* Flags for this OBB type. */ + int32_t mFlags; + const char* mFileName; size_t mFileSize; |