summaryrefslogtreecommitdiff
path: root/tools/stats_log_api_gen/utils.h
diff options
context:
space:
mode:
authorMuhammad Qureshi <muhammadq@google.com>2020-03-31 17:41:57 -0700
committerMuhammad Qureshi <muhammadq@google.com>2020-03-31 17:52:07 -0700
commit4b141386b0f75b832ac7eb5f675b076e4aad264d (patch)
tree1befe97772729d3053705f68c2c06d4fe7756ff4 /tools/stats_log_api_gen/utils.h
parentd11b9a311b9671339600a8a7d027b01663e3b449 (diff)
Use constant names instead of literals
Use constant names instead of literals when writing annotations to increase readability. FrameworkStatsLog.java: https://paste.googleplex.com/4789132691767296 statslog.h: https://paste.googleplex.com/4986214782337024 statslog.cpp: https://paste.googleplex.com/4856851575341056 Bug: 151786433 Test: m statslog-framework-java-gen Test: m libstatslog Change-Id: I47111fe02319bebf41f429642fb675f7a856710b
Diffstat (limited to 'tools/stats_log_api_gen/utils.h')
-rw-r--r--tools/stats_log_api_gen/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/stats_log_api_gen/utils.h b/tools/stats_log_api_gen/utils.h
index 57b6f6254562..1f644426ffa9 100644
--- a/tools/stats_log_api_gen/utils.h
+++ b/tools/stats_log_api_gen/utils.h
@@ -38,6 +38,14 @@ const int JAVA_MODULE_REQUIRES_FLOAT = 0x01;
const int JAVA_MODULE_REQUIRES_ATTRIBUTION = 0x02;
const int JAVA_MODULE_REQUIRES_KEY_VALUE_PAIRS = 0x04;
+const map<unsigned char, string> ANNOTATION_ID_CONSTANTS = {
+ { ANNOTATION_ID_IS_UID, "ANNOTATION_ID_IS_UID" },
+ { ANNOTATION_ID_TRUNCATE_TIMESTAMP, "ANNOTATION_ID_TRUNCATE_TIMESTAMP" },
+ { ANNOTATION_ID_STATE_OPTION, "ANNOTATION_ID_STATE_OPTION" },
+ { ANNOTATION_ID_RESET_STATE, "ANNOTATION_ID_RESET_STATE" },
+ { ANNOTATION_ID_STATE_NESTED, "ANNOTATION_ID_STATE_NESTED" }
+};
+
string make_constant_name(const string& str);
const char* cpp_type_name(java_type_t type);