Make state_option top-level boolean annotations

- Add AnnotationId enum stats-log-api-gen
- Rename RESET_STATE annotation to TRIGGER_STATE_RESET. Also rename the proto annotation.

Bug: 152412767
Test: stats-log-api-gen-test
Test: m statslog-framework-java-gen
Change-Id: I2c12ea0b9222ef28b8cc11ea36b272e518a96259
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 5cd00c3..c7dbf77 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -610,7 +610,7 @@
 message ScreenStateChanged {
     // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
     optional android.view.DisplayStateEnum state = 1
-            [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
+            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
 }
 
 /**
@@ -621,11 +621,11 @@
  *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
  */
 message UidProcessStateChanged {
-    optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
+    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
 
     // The state, from frameworks/base/core/proto/android/app/enums.proto.
     optional android.app.ProcessStateEnum state = 2
-            [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
+            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
 }
 
 /**
@@ -657,7 +657,7 @@
         ASLEEP = 1;
         AWAKE = 2;
     }
-    optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
+    optional State state = 1 [(state_field_option).exclusive_state = true];
 }
 
 /**
@@ -676,7 +676,7 @@
         CRITICAL = 4;   // critical memory.
 
     }
-    optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
+    optional State factor = 1 [(state_field_option).exclusive_state = true];
 }
 
 /**
@@ -854,7 +854,7 @@
  */
 message BleScanStateChanged {
     repeated AttributionNode attribution_node = 1
-            [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
+            [(state_field_option).primary_field_first_uid = true];
 
     enum State {
         OFF = 0;
@@ -863,18 +863,18 @@
         RESET = 2;
     }
     optional State state = 2 [
-        (state_field_option).option = EXCLUSIVE_STATE,
+        (state_field_option).exclusive_state = true,
         (state_field_option).default_state_value = 0 /* State.OFF */,
-        (state_field_option).reset_state_value = 2 /* State.RESET */,
+        (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
         (state_field_option).nested = true
     ];
 
     // Does the scan have a filter.
-    optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
+    optional bool is_filtered = 3 [(state_field_option).primary_field = true];
     // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
-    optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
+    optional bool is_first_match = 4 [(state_field_option).primary_field = true];
     // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
-    optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
+    optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
 }
 
 /**
@@ -1105,15 +1105,14 @@
  */
 message WakelockStateChanged {
     repeated AttributionNode attribution_node = 1
-            [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
+            [(state_field_option).primary_field_first_uid = true];
 
     // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
     // From frameworks/base/core/proto/android/os/enums.proto.
-    optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
-    ;
+    optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
 
     // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
-    optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
+    optional string tag = 3 [(state_field_option).primary_field = true];
 
     enum State {
         RELEASE = 0;
@@ -1122,7 +1121,7 @@
         CHANGE_ACQUIRE = 3;
     }
     optional State state = 4 [
-        (state_field_option).option = EXCLUSIVE_STATE,
+        (state_field_option).exclusive_state = true,
         (state_field_option).default_state_value = 0,
         (state_field_option).nested = true
     ];
@@ -3494,9 +3493,9 @@
  *     services/core/java/com/android/server/wm/Session.java
  */
 message OverlayStateChanged {
-    optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
+    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
 
-    optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
+    optional string package_name = 2 [(state_field_option).primary_field = true];
 
     optional bool using_alert_window = 3;
 
@@ -3505,7 +3504,7 @@
         EXITED = 2;
     }
     optional State state = 4 [
-        (state_field_option).option = EXCLUSIVE_STATE,
+        (state_field_option).exclusive_state = true,
         (state_field_option).nested = false,
         (state_field_option).default_state_value = 2
     ];
@@ -3713,7 +3712,7 @@
  */
 message AppDied {
     // timestamp(elapsedRealtime) of record creation
-    optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
+    optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
 }
 
 /**
@@ -4235,7 +4234,7 @@
         DIALOG_LINE_ITEM = 5;
     }
 
-    optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
+    optional Type type = 1 [(state_field_option).exclusive_state = true];
 
     // Used if the type is LINE_ITEM
     optional string package_name = 2;