ProtoLog: Cache the result of ProtoLogImpl.isEnabled(ProtoLogGroup)
We introduce a generated class ProtoLog$Cache, which contains a field
for each ProtoLogGroup to cache whether it is enabled or not.
This both makes lookup faster, and reduces code size.
Test: make droid
Change-Id: I581c87849c875918b182eff85996b6d19a6755ec
diff --git a/services/core/Android.bp b/services/core/Android.bp
index 4f4e47a..3067beb 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -21,6 +21,7 @@
cmd: "$(location protologtool) transform-protolog-calls " +
"--protolog-class com.android.server.protolog.common.ProtoLog " +
"--protolog-impl-class com.android.server.protolog.ProtoLogImpl " +
+ "--protolog-cache-class 'com.android.server.protolog.ProtoLog$$Cache' " +
"--loggroups-class com.android.server.wm.ProtoLogGroup " +
"--loggroups-jar $(location :services.core.wm.protologgroups) " +
"--output-srcjar $(out) " +