| 1928 | } |
| 1929 | |
| 1930 | bool ResourceTable::hasBagOrEntry(const String16& package, |
| 1931 | const String16& type, |
| 1932 | const String16& name) const |
| 1933 | { |
| 1934 | // First look for this in the included resources... |
| 1935 | uint32_t rid = mAssets->getIncludedResources() |
| 1936 | .identifierForName(name.string(), name.size(), |
| 1937 | type.string(), type.size(), |
| 1938 | package.string(), package.size()); |
| 1939 | if (rid != 0) { |
| 1940 | return true; |
| 1941 | } |
| 1942 | |
| 1943 | sp<Package> p = mPackages.valueFor(package); |
| 1944 | if (p != NULL) { |
| 1945 | sp<Type> t = p->getTypes().valueFor(type); |
| 1946 | if (t != NULL) { |
| 1947 | sp<ConfigList> c = t->getConfigs().valueFor(name); |
| 1948 | if (c != NULL) return true; |
| 1949 | } |
| 1950 | } |
| 1951 | |
| 1952 | return false; |
| 1953 | } |
| 1954 | |
| 1955 | bool ResourceTable::hasBagOrEntry(const String16& package, |
| 1956 | const String16& type, |
no test coverage detected