external_updater: update the proto definition. am: b56cc49ceb am: 1688ce3289 am: bbad5faf88 am: 368ba2b8ee

Original change: https://android-review.googlesource.com/c/platform/tools/external_updater/+/1913606

Change-Id: I50d68f4808ab4a2b6ae7e12bd45801f4b546188e
diff --git a/metadata.proto b/metadata.proto
index f517021..ed72c34 100644
--- a/metadata.proto
+++ b/metadata.proto
@@ -1,4 +1,4 @@
-// copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 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.
@@ -17,14 +17,17 @@
 // This proto will only contain fields and values the updater cares about.
 // It is not intended to be the formal definition of METADATA file.
 
-syntax = "proto3";
+// See google3/third_party/metadata.proto if you need to add more stuff to match
+// upstream.
+
+syntax = "proto2"; // As long as upstream is proto2...
 
 package external_updater;
 
 message MetaData {
-  string name = 1;
-  string description = 3;
-  ThirdPartyMetaData third_party = 13;
+  optional string name = 1;
+  optional string description = 3;
+  optional ThirdPartyMetaData third_party = 13;
 }
 
 enum LicenseType {
@@ -40,10 +43,11 @@
 
 message ThirdPartyMetaData {
   repeated URL url = 1;
-  string version = 2;
-  LicenseType license_type = 4;
-  string license_note = 5;
-  Date last_upgrade_date = 10;
+  optional string version = 2;
+  optional LicenseType license_type = 4;
+  optional string license_note = 5;
+  optional Security security = 7;
+  optional Date last_upgrade_date = 10;
 }
 
 message URL {
@@ -58,13 +62,26 @@
     OTHER = 11;
   }
 
-  Type type = 1;
+  optional Type type = 1;
 
-  string value = 2;
+  optional string value = 2;
 }
 
 message Date {
-  int32 year = 1;
-  int32 month = 2;
-  int32 day = 3;
+  optional int32 year = 1;
+  optional int32 month = 2;
+  optional int32 day = 3;
+}
+
+message Security {
+  enum Category {
+    SANDBOXED_ONLY = 1;
+    TRUSTED_DATA_ONLY = 2;
+    REVIEWED_AND_SECURE = 3;
+  }
+
+  optional Category category = 1;
+  optional string note = 2;
+  repeated string tag = 3;
+  repeated string mitigated_security_patch = 5;
 }