]> git.saurik.com Git - android/aapt.git/commitdiff
am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents...
authorDianne Hackborn <hackbod@google.com>
Thu, 9 Jun 2011 23:06:07 +0000 (16:06 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Thu, 9 Jun 2011 23:06:07 +0000 (16:06 -0700)
* commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942':
  Enforce public resource restriction on bag parents.

ResourceTable.cpp
ResourceTable.h

index 5c5b4fdc3269ede648345886ff7cf18c9f40b66f..81b924af8d7e58192105549e397fc6a11b69d63d 100644 (file)
@@ -1963,10 +1963,11 @@ uint32_t ResourceTable::getResId(const String16& ref,
                                  bool onlyPublic) const
 {
     String16 package, type, name;
+    bool refOnlyPublic = true;
     if (!ResTable::expandResourceRef(
         ref.string(), ref.size(), &package, &type, &name,
         defType, defPackage ? defPackage:&mAssetsPackage,
-        outErrorMsg)) {
+        outErrorMsg, &refOnlyPublic)) {
         NOISY(printf("Expanding resource: ref=%s\n",
                      String8(ref).string()));
         NOISY(printf("Expanding resource: defType=%s\n",
@@ -1979,7 +1980,7 @@ uint32_t ResourceTable::getResId(const String16& ref,
                      String8(name).string()));
         return 0;
     }
-    uint32_t res = getResId(package, type, name, onlyPublic);
+    uint32_t res = getResId(package, type, name, onlyPublic && refOnlyPublic);
     NOISY(printf("Expanded resource: p=%s, t=%s, n=%s, res=%d\n",
                  String8(package).string(), String8(type).string(),
                  String8(name).string(), res));
index bbb81408c8305f9f1271bc609ff3583a4265cc75..734c541f9b6119b8e67545ad18379def650a504a 100644 (file)
@@ -162,13 +162,13 @@ public:
     uint32_t getResId(const String16& package,
                       const String16& type,
                       const String16& name,
-                      bool onlyPublic = false) const;
+                      bool onlyPublic = true) const;
 
     uint32_t getResId(const String16& ref,
                       const String16* defType = NULL,
                       const String16* defPackage = NULL,
                       const char** outErrorMsg = NULL,
-                      bool onlyPublic = false) const;
+                      bool onlyPublic = true) const;
 
     static bool isValidResourceName(const String16& s);