Enable --collapse-resource-names on bundles

This cl enables aapt2 optimize and convert to handle collapsed resource
names optimization.

Test: make aapt2_test

Change-Id: I160d7e5bbd94580b52c00b648918e47beb4674f1
diff --git a/tools/aapt2/LoadedApk.cpp b/tools/aapt2/LoadedApk.cpp
index 45719ef..e930b47 100644
--- a/tools/aapt2/LoadedApk.cpp
+++ b/tools/aapt2/LoadedApk.cpp
@@ -267,8 +267,14 @@
         return false;
       }
     } else if (format_ == ApkFormat::kProto && path == kProtoResourceTablePath) {
+      SerializeTableOptions proto_serialize_options;
+      proto_serialize_options.collapse_key_stringpool =
+          options.collapse_key_stringpool;
+      proto_serialize_options.name_collapse_exemptions =
+          options.name_collapse_exemptions;
       pb::ResourceTable pb_table;
-      SerializeTableToPb(*split_table, &pb_table, context->GetDiagnostics());
+      SerializeTableToPb(*split_table, &pb_table, context->GetDiagnostics(),
+                         proto_serialize_options);
       if (!io::CopyProtoToArchive(context,
                                   &pb_table,
                                   path,