Add --error-on-failed-insert option to aapt.

The new SDK build system give the ability to insert
versionCode/Name and min/targetSdkVersion in the manifest
but aapt won't replace those if they already exist.

The main problem is that aapt doesn't actually fail when
it doesn't replace them, making the output not what the
developer wanted.

This patch set adds an option to aapt to make it return
an error if the insert failed because the attribute
already existed.

Change-Id: I8938ec1238da407a8562c974e9598db39001ffd9
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index a5aa0b5..be08291 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -61,7 +61,7 @@
           mMinSdkVersion(NULL), mTargetSdkVersion(NULL), mMaxSdkVersion(NULL),
           mVersionCode(NULL), mVersionName(NULL), mCustomPackage(NULL), mExtraPackages(NULL),
           mMaxResVersion(NULL), mDebugMode(false), mNonConstantId(false), mProduct(NULL),
-          mUseCrunchCache(false), mArgc(0), mArgv(NULL)
+          mUseCrunchCache(false), mErrorOnFailedInsert(false), mArgc(0), mArgv(NULL)
         {}
     ~Bundle(void) {}
 
@@ -110,6 +110,8 @@
     void setAutoAddOverlay(bool val) { mAutoAddOverlay = val; }
     bool getGenDependencies() { return mGenDependencies; }
     void setGenDependencies(bool val) { mGenDependencies = val; }
+    bool getErrorOnFailedInsert() { return mErrorOnFailedInsert; }
+    void setErrorOnFailedInsert(bool val) { mErrorOnFailedInsert = val; }
 
     bool getUTF16StringsOption() {
         return mWantUTF16 || !isMinSdkAtLeast(SDK_FROYO);
@@ -276,6 +278,7 @@
     bool        mNonConstantId;
     const char* mProduct;
     bool        mUseCrunchCache;
+    bool        mErrorOnFailedInsert;
 
     /* file specification */
     int         mArgc;