From: MÃ¥rten Kongstad Date: Tue, 7 Feb 2012 18:12:45 +0000 (+0100) Subject: Build overlay packages just like regular packages. X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/08a9acaaef4f53c3e09420d947ebe70a6c77a4cd?hp=--cc Build overlay packages just like regular packages. Previously, building overlay packages required passing aapt its -o flag. This commit decouples the idmap generation code from the effects of the -o flag. Since this commit renders the -o flag obsolete, support for the flag was removed from aapt as well. Change-Id: Ied2e0ab8cb800e49623f0a2044b06cd4935473d5 --- 08a9acaaef4f53c3e09420d947ebe70a6c77a4cd diff --git a/Bundle.h b/Bundle.h index 2d1060b..e402d70 100644 --- a/Bundle.h +++ b/Bundle.h @@ -41,7 +41,6 @@ public: mWantUTF16(false), mValues(false), mCompressionMethod(0), mOutputAPKFile(NULL), mManifestPackageNameOverride(NULL), mInstrumentationPackageNameOverride(NULL), - mIsOverlayPackage(false), mAutoAddOverlay(false), mGenDependencies(false), mAssetSourceDir(NULL), mCrunchedOutputDir(NULL), mProguardFile(NULL), @@ -96,8 +95,6 @@ public: void setManifestPackageNameOverride(const char * val) { mManifestPackageNameOverride = val; } const char* getInstrumentationPackageNameOverride() const { return mInstrumentationPackageNameOverride; } void setInstrumentationPackageNameOverride(const char * val) { mInstrumentationPackageNameOverride = val; } - bool getIsOverlayPackage() const { return mIsOverlayPackage; } - void setIsOverlayPackage(bool val) { mIsOverlayPackage = val; } bool getAutoAddOverlay() { return mAutoAddOverlay; } void setAutoAddOverlay(bool val) { mAutoAddOverlay = val; } bool getGenDependencies() { return mGenDependencies; } @@ -235,7 +232,6 @@ private: const char* mOutputAPKFile; const char* mManifestPackageNameOverride; const char* mInstrumentationPackageNameOverride; - bool mIsOverlayPackage; bool mAutoAddOverlay; bool mGenDependencies; const char* mAssetSourceDir; diff --git a/Main.cpp b/Main.cpp index 50c828d..d5d2230 100644 --- a/Main.cpp +++ b/Main.cpp @@ -69,7 +69,6 @@ void usage(void) " [-F apk-file] [-J R-file-dir] \\\n" " [--product product1,product2,...] \\\n" " [-c CONFIGS] [--preferred-configurations CONFIGS] \\\n" - " [-o] \\\n" " [raw-files-dir [raw-files-dir] ...]\n" "\n" " Package the android resources. It will read assets and resources that are\n" @@ -110,7 +109,6 @@ void usage(void) " -j specify a jar or zip file containing classes to include\n" " -k junk path of file(s) added\n" " -m make package directories under location specified by -J\n" - " -o create overlay package (ie only resources; expects in manifest)\n" #if 0 " -p pseudolocalize the default configuration\n" #endif @@ -292,9 +290,6 @@ int main(int argc, char* const argv[]) case 'm': bundle.setMakePackageDirs(true); break; - case 'o': - bundle.setIsOverlayPackage(true); - break; #if 0 case 'p': bundle.setPseudolocalize(true); diff --git a/ResourceTable.cpp b/ResourceTable.cpp index fdb39ca..20e221d 100644 --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@ -3609,9 +3609,7 @@ sp ResourceTable::getPackage(const String16& package) { sp p = mPackages.valueFor(package); if (p == NULL) { - if (mBundle->getIsOverlayPackage()) { - p = new Package(package, 0x00); - } else if (mIsAppPackage) { + if (mIsAppPackage) { if (mHaveAppPackage) { fprintf(stderr, "Adding multiple application package resources; only one is allowed.\n" "Use -x to create extended resources.\n");