diff options
author | Muhammad Qureshi <muhammadq@google.com> | 2020-04-01 16:11:53 -0700 |
---|---|---|
committer | Muhammad Qureshi <muhammadq@google.com> | 2020-04-03 17:00:55 -0700 |
commit | 3f9c330eefa661c2f443568f4dd97a3057b1323d (patch) | |
tree | 35be331b62727f265c2c990b27ec1e25b09e5418 /tools/stats_log_api_gen/java_writer.cpp | |
parent | 5afebd9a448bfb2112ca51645a2f48570064c9c1 (diff) |
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
Diffstat (limited to 'tools/stats_log_api_gen/java_writer.cpp')
-rw-r--r-- | tools/stats_log_api_gen/java_writer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/stats_log_api_gen/java_writer.cpp b/tools/stats_log_api_gen/java_writer.cpp index 54c5b9059fb0..556cf5e12d01 100644 --- a/tools/stats_log_api_gen/java_writer.cpp +++ b/tools/stats_log_api_gen/java_writer.cpp @@ -63,11 +63,10 @@ static void write_annotations(FILE* out, int argIndex, int resetState = -1; int defaultState = -1; for (const shared_ptr<Annotation>& annotation : annotations) { - const string& annotationConstant = - ANNOTATION_ID_CONSTANTS.at(annotation->annotationId); + const string& annotationConstant = ANNOTATION_ID_CONSTANTS.at(annotation->annotationId); switch (annotation->type) { case ANNOTATION_TYPE_INT: - if (ANNOTATION_ID_RESET_STATE == annotation->annotationId) { + if (ANNOTATION_ID_TRIGGER_STATE_RESET == annotation->annotationId) { resetState = annotation->value.intValue; } else if (ANNOTATION_ID_DEFAULT_STATE == annotation->annotationId) { defaultState = annotation->value.intValue; @@ -87,7 +86,7 @@ static void write_annotations(FILE* out, int argIndex, } if (defaultState != -1 && resetState != -1) { const string& annotationConstant = - ANNOTATION_ID_CONSTANTS.at(ANNOTATION_ID_RESET_STATE); + ANNOTATION_ID_CONSTANTS.at(ANNOTATION_ID_TRIGGER_STATE_RESET); fprintf(out, " if (arg%d == %d) {\n", argIndex, resetState); fprintf(out, " builder.addIntAnnotation(%s, %d);\n", annotationConstant.c_str(), defaultState); |