Move tag definitions into policy
Currently, the tags are defined in system/core.
Instead, reserve a range in system/core and define the tags in policy.
Next, we add a flag for interceptKeyBeforeQueueing.
Bug: 128933363
Test: adb logcat -b events, turn on screen, then press power button and
observe the logs.
Change-Id: I1fde2a2e7451ec67987ad3b09abc28be64410427
diff --git a/services/core/Android.bp b/services/core/Android.bp
index 259aa50..c154240 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -21,6 +21,7 @@
":gsiservice_aidl",
"java/com/android/server/EventLogTags.logtags",
"java/com/android/server/am/EventLogTags.logtags",
+ "java/com/android/server/policy/EventLogTags.logtags",
],
libs: [
diff --git a/services/core/java/com/android/server/policy/EventLogTags.logtags b/services/core/java/com/android/server/policy/EventLogTags.logtags
new file mode 100644
index 0000000..7563382
--- /dev/null
+++ b/services/core/java/com/android/server/policy/EventLogTags.logtags
@@ -0,0 +1,8 @@
+# See system/core/logcat/event.logtags for a description of the format of this file.
+
+option java_package com.android.server.policy
+
+
+# 0 for screen off, 1 for screen on
+70000 screen_toggled (screen_state|1|5)
+70001 intercept_power (action|3),(mPowerKeyHandled|1),(mPowerKeyPressCounter|1)
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 1c5c7a3..7c87462 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -167,7 +167,6 @@
import android.service.vr.IPersistentVrStateCallbacks;
import android.speech.RecognizerIntent;
import android.telecom.TelecomManager;
-import android.util.EventLog;
import android.util.Log;
import android.util.LongSparseArray;
import android.util.MutableBoolean;
@@ -3807,9 +3806,9 @@
}
case KeyEvent.KEYCODE_POWER: {
- Slog.d(TAG, "interceptKeyBeforeQueueing: KEYCODE_POWER "
- + KeyEvent.actionToString(event.getAction())
- + " mPowerKeyHandled=" + mPowerKeyHandled + " b/128933363");
+ EventLogTags.writeInterceptPower(
+ KeyEvent.actionToString(event.getAction()),
+ mPowerKeyHandled ? 1 : 0, mPowerKeyPressCounter);
// Any activity on the power button stops the accessibility shortcut
cancelPendingAccessibilityShortcutAction();
result &= ~ACTION_PASS_TO_USER;
@@ -4359,7 +4358,7 @@
// Called on the PowerManager's Notifier thread.
@Override
public void finishedGoingToSleep(int why) {
- EventLog.writeEvent(70000, 0);
+ EventLogTags.writeScreenToggled(0);
if (DEBUG_WAKEUP) {
Slog.i(TAG, "Finished going to sleep... (why="
+ WindowManagerPolicyConstants.offReasonToString(why) + ")");
@@ -4391,7 +4390,7 @@
// Called on the PowerManager's Notifier thread.
@Override
public void startedWakingUp(@OnReason int why) {
- EventLog.writeEvent(70000, 1);
+ EventLogTags.writeScreenToggled(1);
if (DEBUG_WAKEUP) {
Slog.i(TAG, "Started waking up... (why="
+ WindowManagerPolicyConstants.onReasonToString(why) + ")");