AAPT: Fix --feature-of to allow non-public symbol visibility

Test: manual
Change-Id: Iada18b201c6463011002f96285a64c64565a6e1c
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 661409e..b9bf799 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -2204,8 +2204,10 @@
                            package.string(), package.size(),
                            &specFlags);
     if (rid != 0) {
-        if (onlyPublic) {
-            if ((specFlags & ResTable_typeSpec::SPEC_PUBLIC) == 0) {
+        if (onlyPublic && (specFlags & ResTable_typeSpec::SPEC_PUBLIC) == 0) {
+            // If this is a feature split and the resource has the same
+            // package name as us, then everything is public.
+            if (mPackageType != AppFeature || mAssetsPackage != package) {
                 return 0;
             }
         }