| 51 | static const String16 RESOURCES_TOOLS_NAMESPACE("http://schemas.android.com/tools"); |
| 52 | |
| 53 | String16 getNamespaceResourcePackage(String16 appPackage, String16 namespaceUri, bool* outIsPublic) |
| 54 | { |
| 55 | //printf("%s starts with %s?\n", String8(namespaceUri).string(), |
| 56 | // String8(RESOURCES_PREFIX).string()); |
| 57 | size_t prefixSize; |
| 58 | bool isPublic = true; |
| 59 | if(namespaceUri.startsWith(RESOURCES_PREFIX_AUTO_PACKAGE)) { |
| 60 | NOISY(printf("Using default application package: %s -> %s\n", String8(namespaceUri).string(), String8(appPackage).string())); |
| 61 | isPublic = true; |
| 62 | return appPackage; |
| 63 | } else if (namespaceUri.startsWith(RESOURCES_PREFIX)) { |
| 64 | prefixSize = RESOURCES_PREFIX.size(); |
| 65 | } else if (namespaceUri.startsWith(RESOURCES_PRV_PREFIX)) { |
| 66 | isPublic = false; |
| 67 | prefixSize = RESOURCES_PRV_PREFIX.size(); |
| 68 | } else { |
| 69 | if (outIsPublic) *outIsPublic = isPublic; // = true |
| 70 | return String16(); |
| 71 | } |
| 72 | |
| 73 | //printf("YES!\n"); |
| 74 | //printf("namespace: %s\n", String8(String16(namespaceUri, namespaceUri.size()-prefixSize, prefixSize)).string()); |
| 75 | if (outIsPublic) *outIsPublic = isPublic; |
| 76 | return String16(namespaceUri, namespaceUri.size()-prefixSize, prefixSize); |
| 77 | } |
| 78 | |
| 79 | status_t hasSubstitutionErrors(const char* fileName, |
| 80 | ResXMLTree* inXml, |
no test coverage detected