diff options
author | Kenny Root <kroot@google.com> | 2010-08-19 09:09:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-19 09:09:32 -0700 |
commit | 54d41379357d1d800d0a7bd7c5dc56111710482a (patch) | |
tree | d755ffce6dcf08e25e081b61ec43817f8fdc9a58 /include | |
parent | 8c192fe990d7bc7149d2ec1a7c9f4ada3f32e52a (diff) | |
parent | 02ca31fbae9f35dd30f79de6927fae11b549391a (diff) | |
download | frameworks_base-54d41379357d1d800d0a7bd7c5dc56111710482a.zip frameworks_base-54d41379357d1d800d0a7bd7c5dc56111710482a.tar.gz frameworks_base-54d41379357d1d800d0a7bd7c5dc56111710482a.tar.bz2 |
Merge "Add OBB flags to support overlays" into gingerbread
Diffstat (limited to 'include')
-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; |