Snap for 10453563 from c555067672c78afd1b55a506b3ca283f60b3b1f5 to mainline-ipsec-release

Change-Id: I87803efb02eb387478f02380e867d0cb20ef6e24
diff --git a/API-level-policy/33/Android.bp b/API-level-policy/33/Android.bp
index 9c128a2..01fde8e 100644
--- a/API-level-policy/33/Android.bp
+++ b/API-level-policy/33/Android.bp
@@ -26,6 +26,7 @@
         ":apex_service_contexts-33",
         ":apex_seapp_contexts-33",
         ":apex_sepolicy-33.cil",
+        ":apex_sepolicy-33.decompiled.cil",
         ":apex_sepolicy.sha256",
         ":sepolicy_apex_test_file",
 
@@ -68,6 +69,20 @@
     filename: "SEPolicy-33.zip.fsv_sig",
 }
 
+genrule {
+    name: "SEPolicy-33.pb.gen",
+    defaults: ["sepolicy_info_bin_gen_default"],
+    srcs: ["SEPolicy-33.textproto"],
+    out: ["SEPolicy-33.pb.gen"],
+}
+
+prebuilt_etc {
+    name: "SEPolicy-33.pb",
+    src: ":SEPolicy-33.pb.gen",
+    installable: false,
+    filename: "SEPolicy-33.pb",
+}
+
 // Versions of the most up-to-date apex sepolicies are installed on /system.
 prebuilt_etc {
     name: "SEPolicy.zip",
diff --git a/API-level-policy/33/SEPolicy-33.textproto b/API-level-policy/33/SEPolicy-33.textproto
new file mode 100644
index 0000000..dda0854
--- /dev/null
+++ b/API-level-policy/33/SEPolicy-33.textproto
@@ -0,0 +1 @@
+packagename: "com.android.sepolicy.sepolicy_33"
\ No newline at end of file
diff --git a/API-level-policy/Android.bp b/API-level-policy/Android.bp
index 0ab3fa8..c00e6be 100644
--- a/API-level-policy/Android.bp
+++ b/API-level-policy/Android.bp
@@ -32,7 +32,7 @@
     tool_files: [":SEPolicyKeyPem", ":SEPolicyCertPem"],
     // Use fsverity tool to generate the signature file which
     // will be stored in the apex.
-    // https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git/tree/README.md
+    // https://git.kernel.org/pub/scm/fs/fsverity/fsverity-utils.git/tree/README.md
     cmd: "$(location fsverity) sign $(in) $(out) " +
         "--key=$(location :SEPolicyKeyPem) " +
         "--cert=$(location :SEPolicyCertPem) " +
@@ -47,6 +47,19 @@
         "$(location soong_zip) -o $(out) -C $(genDir)/files -D $(genDir)/files",
 }
 
+filegroup {
+    name: "sepolicy_proto_def",
+    srcs: [ "sepolicy.proto" ],
+}
+
+genrule_defaults {
+    name: "sepolicy_info_bin_gen_default",
+    tools: ["aprotoc"],
+    tool_files: [ ":sepolicy_proto_def" ],
+    cmd: "$(location aprotoc) --encode=com.android.sepolicy.SepolicyInfo " +
+        "-I $$(dirname $(location :sepolicy_proto_def)) $(location :sepolicy_proto_def) < $(in) > $(out)",
+}
+
 prebuilt_etc {
     name: "sepolicy_apex_test_file",
     src: "sepolicy_apex_test_file",
diff --git a/API-level-policy/sepolicy.proto b/API-level-policy/sepolicy.proto
new file mode 100644
index 0000000..8aff4a8
--- /dev/null
+++ b/API-level-policy/sepolicy.proto
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+
+package com.android.sepolicy;
+
+option java_package = "com.android.sepolicy";
+option java_outer_classname = "Sepolicy";
+
+message SepolicyInfo {
+  // A packagename to identify a versioned policy.
+  optional string packagename = 1;
+}
\ No newline at end of file
diff --git a/apex/Android.bp b/apex/Android.bp
index 8c9129c..ebe4a31 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -28,11 +28,13 @@
         "SEPolicy-33.zip.sig",
         "SEPolicy-33.zip.fsv_sig",
         "SEPolicy-33.zip",
+        "SEPolicy-33.pb"
     ],
     required: [
         "SEPolicy.zip.sig",
         "SEPolicy.zip.fsv_sig",
         "SEPolicy.zip",
+        "SEPolicy-33.pb",
     ],
 }