| 663 | |
| 664 | |
| 665 | status_t parseAndAddEntry(Bundle* bundle, |
| 666 | const sp<AaptFile>& in, |
| 667 | ResXMLTree* block, |
| 668 | const ResTable_config& config, |
| 669 | const String16& myPackage, |
| 670 | const String16& curType, |
| 671 | const String16& ident, |
| 672 | const String16& curTag, |
| 673 | bool curIsStyled, |
| 674 | int32_t curFormat, |
| 675 | bool isFormatted, |
| 676 | const String16& product, |
| 677 | bool pseudolocalize, |
| 678 | const bool overwrite, |
| 679 | KeyedVector<type_ident_pair_t, bool>* skippedResourceNames, |
| 680 | ResourceTable* outTable) |
| 681 | { |
| 682 | status_t err; |
| 683 | |
| 684 | String16 str; |
| 685 | Vector<StringPool::entry_style_span> spans; |
| 686 | err = parseStyledString(bundle, in->getPrintableSource().string(), block, |
| 687 | curTag, &str, curIsStyled ? &spans : NULL, |
| 688 | isFormatted, pseudolocalize); |
| 689 | |
| 690 | if (err < NO_ERROR) { |
| 691 | return err; |
| 692 | } |
| 693 | |
| 694 | /* |
| 695 | * If a product type was specified on the command line |
| 696 | * and also in the string, and the two are not the same, |
| 697 | * return without adding the string. |
| 698 | */ |
| 699 | |
| 700 | const char *bundleProduct = bundle->getProduct(); |
| 701 | if (bundleProduct == NULL) { |
| 702 | bundleProduct = ""; |
| 703 | } |
| 704 | |
| 705 | if (product.size() != 0) { |
| 706 | /* |
| 707 | * If the command-line-specified product is empty, only "default" |
| 708 | * matches. Other variants are skipped. This is so generation |
| 709 | * of the R.java file when the product is not known is predictable. |
| 710 | */ |
| 711 | |
| 712 | if (bundleProduct[0] == '\0') { |
| 713 | if (strcmp16(String16("default").string(), product.string()) != 0) { |
| 714 | /* |
| 715 | * This string has a product other than 'default'. Do not add it, |
| 716 | * but record it so that if we do not see the same string with |
| 717 | * product 'default' or no product, then report an error. |
| 718 | */ |
| 719 | skippedResourceNames->replaceValueFor( |
| 720 | type_ident_pair_t(curType, ident), true); |
| 721 | return NO_ERROR; |
| 722 | } |
no test coverage detected