Add <staging-public-group-final> to aapt2 (2/2)

Fixes BinaryResourceParser loading of alias chunk and makes changes
that did not get committed in 2fedba9a32d9e92344eaf6e9faf5b43e1bc2ae70.

Bug: 183411356
Test: aapt2_test
Change-Id: Ieff9166100019f38ddcfe900014709b15db24e43
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index 7d061fb..320106a 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -226,9 +226,9 @@
       // staging aliases can only be defined by the framework package (which is not a shared
       // library), the compile-time package id of the framework is the same across all packages
       // that compile against the framework.
-      for (const auto& package : iter2->packages_) {
+      for (const auto& package : iter->packages_) {
         for (const auto& entry : package.loaded_package_->GetAliasResourceIdMap()) {
-          iter->dynamic_ref_table->addAlias(entry.first, entry.second);
+          iter2->dynamic_ref_table->addAlias(entry.first, entry.second);
         }
       }
     }