Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7f93070 authored by Yi Jin's avatar Yi Jin
Browse files

Convert proto3 to proto2 to avoid forced zero enum value.

The rationale for this change:
1. When defining enum values for platform, we want to use the current
integers, in some cases zero is not defined, but proto3 enforces a zero
default value.

2. Android Metrics Team uses proto2 on server-side

3. When copying .proto to server-side, the known issue of dropping
unknown fields might affect if using proto3

4. Not much benefits from using proto3

Bug: 67110257
Test: manully generate incident report and it looks normal
Change-Id: Ia63e39de549a46683e9f80fcb74f1d771782b7f4
parent fcf52c6f
Loading
Loading
Loading
Loading
+17 −18
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
 * limitations under the License.
 */

syntax = "proto3";

syntax = "proto2";
option java_package = "android.app";
option java_multiple_files = true;

@@ -27,28 +26,28 @@ import "frameworks/base/core/proto/android/media/audioattributes.proto";
 * An android.app.NotificationChannel object.
 */
message NotificationChannelProto {
    string id = 1;
    string name = 2;
    string description = 3;
    int32 importance = 4;
    bool can_bypass_dnd = 5;
    optional string id = 1;
    optional string name = 2;
    optional string description = 3;
    optional int32 importance = 4;
    optional bool can_bypass_dnd = 5;
    // Default is VISIBILITY_NO_OVERRIDE (-1000).
    int32 lockscreen_visibility = 6;
    string sound = 7;
    bool use_lights = 8;
    optional int32 lockscreen_visibility = 6;
    optional string sound = 7;
    optional bool use_lights = 8;
    // Default is 0.
    int32 light_color = 9;
    optional int32 light_color = 9;
    repeated int64 vibration = 10;
    // Bitwise representation of fields that have been changed by the user,
    // preventing the app from making changes to these fields.
    int32 user_locked_fields = 11;
    bool is_vibration_enabled = 12;
    optional int32 user_locked_fields = 11;
    optional bool is_vibration_enabled = 12;
    // Default is true.
    bool show_badge = 13;
    optional bool show_badge = 13;
    // Default is false.
    bool is_deleted = 14;
    string group = 15;
    android.media.AudioAttributesProto audio_attributes = 16;
    optional bool is_deleted = 14;
    optional string group = 15;
    optional android.media.AudioAttributesProto audio_attributes = 16;
    // If this is a blockable system notification channel.
    bool is_blockable_system = 17;
    optional bool is_blockable_system = 17;
}
+5 −6
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
 * limitations under the License.
 */

syntax = "proto3";

syntax = "proto2";
option java_package = "android.app";
option java_multiple_files = true;

@@ -27,9 +26,9 @@ import "frameworks/base/core/proto/android/app/notification_channel.proto";
 * An android.app.NotificationChannelGroup object.
 */
message NotificationChannelGroupProto {
    string id = 1;
    string name = 2;
    string description = 3;
    bool is_blocked = 4;
    optional string id = 1;
    optional string name = 2;
    optional string description = 3;
    optional bool is_blocked = 4;
    repeated android.app.NotificationChannelProto channels = 5;
}
+3 −4
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
 * limitations under the License.
 */

syntax = "proto3";

syntax = "proto2";
option java_package = "android.app";
option java_multiple_files = true;

@@ -48,8 +47,8 @@ message PolicyProto {
        // Only starred contacts are prioritized.
        STARRED = 2;
    }
    Sender priority_call_sender = 2;
    Sender priority_message_sender = 3;
    optional Sender priority_call_sender = 2;
    optional Sender priority_message_sender = 3;

    enum SuppressedVisualEffect {
        SVE_UNKNOWN = 0;
+4 −5
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
 * limitations under the License.
 */

syntax = "proto3";

syntax = "proto2";
option java_package = "android.app";
option java_multiple_files = true;

@@ -25,7 +24,7 @@ import "frameworks/base/core/proto/android/graphics/rect.proto";

/** Proto representation for WindowConfiguration.java class. */
message WindowConfigurationProto {
  .android.graphics.RectProto app_bounds = 1;
  int32 windowing_mode = 2;
  int32 activity_type = 3;
  optional .android.graphics.RectProto app_bounds = 1;
  optional int32 windowing_mode = 2;
  optional int32 activity_type = 3;
}
+3 −4
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
 * limitations under the License.
 */

syntax = "proto3";

syntax = "proto2";
option java_package = "android.content";
option java_multiple_files = true;

@@ -25,7 +24,7 @@ package android.content;
 * An android.content.ComponentName object.
 */
message ComponentNameProto {
    string package_name = 1;
    string class_name = 2;
    optional string package_name = 1;
    optional string class_name = 2;
}
Loading