summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-20 21:17:17 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-24 14:09:39 +0000
commitad3c9416092f09213d32eee8b59287766eae5d19 (patch)
tree0bc1e318ca15560299c662e37c6c4fedf0bcf1e6 /tools
parent7d114fb838017d86ece76e18a7e1b0d8534595fa (diff)
downloadframeworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.zip
frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.tar.gz
frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.tar.bz2
Squashed commit of the theme engine support.
Updated 4.2 support for the old T-Mobile theme engine, as usual needs the provider and switcher apps installed as well. I'm finally dropping the 400+ commit history on this, since everybody else keeps picking it up from CM as a single patch anyway... But for the record, nothing of this would be possible without Josh, Ed, and the rest of the TMo guys who wrote and maintained it until 2.2: amit chabra <amit.chabra@t-mobile.com> Amit Kohli <amit.kohli@t-mobile.com> Chris Cogar <chriscogar@t-mobile.com> Dirk Sigurdson <dirk.sigurdson@t-mobile.com> Ed Carrigan <edward.carrigan@t-mobile.com> Gaurav Sharma <gaurav.sharma3@t-mobile.com> Hui Feng <hui.feng@t-mobile.com> John Ritz <john.ritz1@t-mobile.com> Josh Guilfoyle <josh.guilfoyle@t-mobile.com> Mark Roberts <mark.roberts48@t-mobile.com> Pankaj Kumar <Pankaj.kumar6@t-mobile.com> Samuel Cheung <samuel.cheung@t-mobile.com> Sergey Ten <sergey.ten6@t-mobile.com> Change-Id: I7148d51be48f28a2dc4bdf9ec9018f04b268ffc4
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/Bundle.h6
-rw-r--r--tools/aapt/Main.cpp14
-rw-r--r--tools/aapt/ResourceTable.cpp12
3 files changed, 28 insertions, 4 deletions
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index fde3bd6..a39f667 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -1,5 +1,6 @@
//
// Copyright 2006 The Android Open Source Project
+// This code has been modified. Portions copyright (C) 2010, T-Mobile USA, Inc.
//
// State bundle. Used to pass around stuff like command-line args.
//
@@ -48,7 +49,7 @@ public:
Bundle(void)
: mCmd(kCommandUnknown), mVerbose(false), mAndroidList(false),
mForce(false), mGrayscaleTolerance(0), mMakePackageDirs(false),
- mUpdate(false), mExtending(false),
+ mUpdate(false), mExtending(false), mExtendedPackageId(0),
mRequireLocalization(false), mPseudolocalize(false),
mWantUTF16(false), mValues(false),
mCompressionMethod(0), mJunkPath(false), mOutputAPKFile(NULL),
@@ -90,6 +91,8 @@ public:
void setUpdate(bool val) { mUpdate = val; }
bool getExtending(void) const { return mExtending; }
void setExtending(bool val) { mExtending = val; }
+ int getExtendedPackageId(void) const { return mExtendedPackageId; }
+ void setExtendedPackageId(int val) { mExtendedPackageId = val; }
bool getRequireLocalization(void) const { return mRequireLocalization; }
void setRequireLocalization(bool val) { mRequireLocalization = val; }
bool getPseudolocalize(void) const { return mPseudolocalize; }
@@ -243,6 +246,7 @@ private:
bool mMakePackageDirs;
bool mUpdate;
bool mExtending;
+ int mExtendedPackageId;
bool mRequireLocalization;
bool mPseudolocalize;
bool mWantUTF16;
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index f398de0..946eaae 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -1,5 +1,6 @@
//
// Copyright 2006 The Android Open Source Project
+// This code has been modified. Portions copyright (C) 2010, T-Mobile USA, Inc.
//
// Android Asset Packaging Tool main entry point.
//
@@ -14,6 +15,7 @@
#include <stdlib.h>
#include <getopt.h>
#include <assert.h>
+#include <ctype.h>
using namespace android;
@@ -55,7 +57,7 @@ void usage(void)
" xmltree Print the compiled xmls in the given assets.\n"
" xmlstrings Print the strings of the given compiled xml assets.\n\n", gProgName);
fprintf(stderr,
- " %s p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \\\n"
+ " %s p[ackage] [-d][-f][-m][-u][-v][-x[ extending-resource-id]][-z][-M AndroidManifest.xml] \\\n"
" [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \\\n"
" [--debug-mode] [--min-sdk-version VAL] [--target-sdk-version VAL] \\\n"
" [--app-version VAL] [--app-version-name TEXT] [--custom-package VAL] \\\n"
@@ -115,7 +117,7 @@ void usage(void)
#endif
" -u update existing packages (add new, replace older, remove deleted files)\n"
" -v verbose output\n"
- " -x create extending (non-application) resource IDs\n"
+ " -x either create or assign (if specified) extending (non-application) resource IDs\n"
" -z require localization of resource attributes marked with\n"
" localization=\"suggested\"\n"
" -A additional directory in which to find raw asset files\n"
@@ -313,6 +315,14 @@ int main(int argc, char* const argv[])
break;
case 'x':
bundle.setExtending(true);
+ argc--;
+ argv++;
+ if (!argc || !isdigit(argv[0][0])) {
+ argc++;
+ argv--;
+ } else {
+ bundle.setExtendedPackageId(atoi(argv[0]));
+ }
break;
case 'z':
bundle.setRequireLocalization(true);
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 3d7b088..b370dca 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -1,5 +1,6 @@
//
// Copyright 2006 The Android Open Source Project
+// This code has been modified. Portions copyright (C) 2010, T-Mobile USA, Inc.
//
// Build resource files from raw assets.
//
@@ -3750,7 +3751,16 @@ sp<ResourceTable::Package> ResourceTable::getPackage(const String16& package)
mHaveAppPackage = true;
p = new Package(package, 127);
} else {
- p = new Package(package, mNextPackageId);
+ int extendedPackageId = mBundle->getExtendedPackageId();
+ if (extendedPackageId != 0) {
+ if ((uint32_t)extendedPackageId < mNextPackageId) {
+ fprintf(stderr, "Package ID %d already in use!\n", mNextPackageId);
+ return NULL;
+ }
+ p = new Package(package, extendedPackageId);
+ } else {
+ p = new Package(package, mNextPackageId);
+ }
}
//printf("*** NEW PACKAGE: \"%s\" id=%d\n",
// String8(package).string(), p->getAssignedId());