+status_t AaptSymbols::applyJavaSymbols(const sp<AaptSymbols>& javaSymbols)
+{
+ status_t err = NO_ERROR;
+ size_t N = javaSymbols->mSymbols.size();
+ for (size_t i=0; i<N; i++) {
+ const String8& name = javaSymbols->mSymbols.keyAt(i);
+ const AaptSymbolEntry& entry = javaSymbols->mSymbols.valueAt(i);
+ ssize_t pos = mSymbols.indexOfKey(name);
+ if (pos < 0) {
+ entry.sourcePos.error("Symbol '%s' declared with <java-symbol> not defined\n", name.string());
+ err = UNKNOWN_ERROR;
+ continue;
+ }
+ //printf("**** setting symbol #%d/%d %s to isJavaSymbol=%d\n",
+ // i, N, name.string(), entry.isJavaSymbol ? 1 : 0);
+ mSymbols.editValueAt(pos).isJavaSymbol = entry.isJavaSymbol;
+ }
+
+ N = javaSymbols->mNestedSymbols.size();
+ for (size_t i=0; i<N; i++) {
+ const String8& name = javaSymbols->mNestedSymbols.keyAt(i);
+ const sp<AaptSymbols>& symbols = javaSymbols->mNestedSymbols.valueAt(i);
+ ssize_t pos = mNestedSymbols.indexOfKey(name);
+ if (pos < 0) {
+ SourcePos pos;
+ pos.error("Java symbol dir %s not defined\n", name.string());
+ err = UNKNOWN_ERROR;
+ continue;
+ }
+ //printf("**** applying java symbols in dir %s\n", name.string());
+ status_t myerr = mNestedSymbols.valueAt(pos)->applyJavaSymbols(symbols);
+ if (myerr != NO_ERROR) {
+ err = myerr;
+ }
+ }
+
+ return err;
+}
+
+// =========================================================================
+// =========================================================================
+// =========================================================================
+