]> git.saurik.com Git - android/aapt.git/blobdiff - ResourceTable.cpp
am 4bb78889: am 40277df7: Merge "Add "television" mode." into honeycomb-mr2
[android/aapt.git] / ResourceTable.cpp
index 3dcc0939985073dc8e0f1def80721ba0c5fa3c7f..5c5b4fdc3269ede648345886ff7cf18c9f40b66f 100644 (file)
@@ -2607,6 +2607,9 @@ ResourceFilter::match(const ResTable_config& config) const
     if (!match(AXIS_SCREENSIZE, config.screenSize)) {
         return false;
     }
+    if (!match(AXIS_SMALLESTSCREENWIDTHDP, config.smallestScreenWidthDp)) {
+        return false;
+    }
     if (!match(AXIS_SCREENWIDTHDP, config.screenWidthDp)) {
         return false;
     }
@@ -2809,7 +2812,8 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
                 ConfigDescription config = t->getUniqueConfigs().itemAt(ci);
 
                 NOISY(printf("Writing config %d config: imsi:%d/%d lang:%c%c cnt:%c%c "
-                     "orien:%d ui:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d %ddp x %ddp\n",
+                     "orien:%d ui:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d "
+                     "sw%ddp w%ddp h%ddp\n",
                       ti+1,
                       config.mcc, config.mnc,
                       config.language[0] ? config.language[0] : '-',
@@ -2825,6 +2829,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
                       config.navigation,
                       config.screenWidth,
                       config.screenHeight,
+                      config.smallestScreenWidthDp,
                       config.screenWidthDp,
                       config.screenHeightDp));
                       
@@ -2849,7 +2854,8 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
                 tHeader->entriesStart = htodl(typeSize);
                 tHeader->config = config;
                 NOISY(printf("Writing type %d config: imsi:%d/%d lang:%c%c cnt:%c%c "
-                     "orien:%d ui:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d %ddp x %ddp\n",
+                     "orien:%d ui:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d "
+                     "sw%ddp w%ddp h%ddp\n",
                       ti+1,
                       tHeader->config.mcc, tHeader->config.mnc,
                       tHeader->config.language[0] ? tHeader->config.language[0] : '-',
@@ -2865,6 +2871,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
                       tHeader->config.navigation,
                       tHeader->config.screenWidth,
                       tHeader->config.screenHeight,
+                      tHeader->config.smallestScreenWidthDp,
                       tHeader->config.screenWidthDp,
                       tHeader->config.screenHeightDp));
                 tHeader->config.swapHtoD();
@@ -3448,7 +3455,8 @@ sp<ResourceTable::Entry> ResourceTable::Type::getEntry(const String16& entry,
     if (e == NULL) {
         if (config != NULL) {
             NOISY(printf("New entry at %s:%d: imsi:%d/%d lang:%c%c cnt:%c%c "
-                    "orien:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d %ddp x %ddp\n",
+                    "orien:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d "
+                    "sw%ddp w%ddp h%ddp\n",
                       sourcePos.file.string(), sourcePos.line,
                       config->mcc, config->mnc,
                       config->language[0] ? config->language[0] : '-',
@@ -3463,6 +3471,7 @@ sp<ResourceTable::Entry> ResourceTable::Type::getEntry(const String16& entry,
                       config->navigation,
                       config->screenWidth,
                       config->screenHeight,
+                      config->smallestScreenWidthDp,
                       config->screenWidthDp,
                       config->screenHeightDp));
         } else {
@@ -3696,7 +3705,9 @@ sp<ResourceTable::Package> ResourceTable::getPackage(const String16& package)
 {
     sp<Package> p = mPackages.valueFor(package);
     if (p == NULL) {
-        if (mIsAppPackage) {
+        if (mBundle->getIsOverlayPackage()) {
+            p = new Package(package, 0x00);
+        } else if (mIsAppPackage) {
             if (mHaveAppPackage) {
                 fprintf(stderr, "Adding multiple application package resources; only one is allowed.\n"
                                 "Use -x to create extended resources.\n");