Add event log for keyguard occlude status chagne.

Bug: 271433779
Test: adb logcat -b events
Merged-In: Id32e7db9d2147e4a5458dd313edfd453ade74d51
Change-Id: Id32e7db9d2147e4a5458dd313edfd453ade74d51
This commit is contained in:
Issei Suzuki
2023-03-02 17:20:29 +00:00
parent f950c81209
commit 0871b2996c
4 changed files with 35 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ import com.android.internal.policy.IKeyguardExitCallback;
import com.android.internal.policy.IKeyguardService; import com.android.internal.policy.IKeyguardService;
import com.android.server.UiThread; import com.android.server.UiThread;
import com.android.server.policy.WindowManagerPolicy.OnKeyguardExitResult; import com.android.server.policy.WindowManagerPolicy.OnKeyguardExitResult;
import com.android.server.wm.EventLogTags;
import java.io.PrintWriter; import java.io.PrintWriter;
@@ -255,6 +256,11 @@ public class KeyguardServiceDelegate {
public void setOccluded(boolean isOccluded, boolean notify) { public void setOccluded(boolean isOccluded, boolean notify) {
if (mKeyguardService != null && notify) { if (mKeyguardService != null && notify) {
if (DEBUG) Log.v(TAG, "setOccluded(" + isOccluded + ")"); if (DEBUG) Log.v(TAG, "setOccluded(" + isOccluded + ")");
EventLogTags.writeWmSetKeyguardOccluded(
isOccluded ? 1 : 0,
0 /* animate */,
0 /* transit */,
"setOccluded");
mKeyguardService.setOccluded(isOccluded, false /* animate */); mKeyguardService.setOccluded(isOccluded, false /* animate */);
} }
mKeyguardState.occluded = isOccluded; mKeyguardState.occluded = isOccluded;

View File

@@ -49,7 +49,7 @@ option java_package com.android.server.wm
30066 wm_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3) 30066 wm_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3)
# Keyguard status changed # Keyguard status changed
30067 wm_set_keyguard_shown (Display Id|1|5),(keyguardShowing|1),(aodShowing|1),(keyguardGoingAway|1),(Reason|3) 30067 wm_set_keyguard_shown (Display Id|1|5),(keyguardShowing|1),(aodShowing|1),(keyguardGoingAway|1),(occluded|1),(Reason|3)
# Out of memory for surfaces. # Out of memory for surfaces.
31000 wm_no_surface_memory (Window|3),(PID|1|5),(Operation|3) 31000 wm_no_surface_memory (Window|3),(PID|1|5),(Operation|3)
@@ -65,6 +65,8 @@ option java_package com.android.server.wm
# bootanim finished: # bootanim finished:
31007 wm_boot_animation_done (time|2|3) 31007 wm_boot_animation_done (time|2|3)
# Notify keyguard occlude statuc change to SysUI.
31008 wm_set_keyguard_occluded (occluded|1),(animate|1),(transit|1),(Channel|3)
# Back navigation. # Back navigation.
31100 wm_back_navi_canceled (Reason|3) 31100 wm_back_navi_canceled (Reason|3)

View File

@@ -188,6 +188,7 @@ class KeyguardController {
keyguardShowing ? 1 : 0, keyguardShowing ? 1 : 0,
aodShowing ? 1 : 0, aodShowing ? 1 : 0,
state.mKeyguardGoingAway ? 1 : 0, state.mKeyguardGoingAway ? 1 : 0,
state.mOccluded ? 1 : 0,
"setKeyguardShown"); "setKeyguardShown");
// Update the task snapshot if the screen will not be turned off. To make sure that the // Update the task snapshot if the screen will not be turned off. To make sure that the
@@ -253,9 +254,10 @@ class KeyguardController {
try { try {
EventLogTags.writeWmSetKeyguardShown( EventLogTags.writeWmSetKeyguardShown(
displayId, displayId,
1 /* keyguardShowing */, state.mKeyguardShowing ? 1 : 0,
state.mAodShowing ? 1 : 0, state.mAodShowing ? 1 : 0,
1 /* keyguardGoingAway */, 1 /* keyguardGoingAway */,
state.mOccluded ? 1 : 0,
"keyguardGoingAway"); "keyguardGoingAway");
final int transitFlags = convertTransitFlags(flags); final int transitFlags = convertTransitFlags(flags);
final DisplayContent dc = mRootWindowContainer.getDefaultDisplay(); final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
@@ -669,6 +671,15 @@ class KeyguardController {
boolean hasChange = false; boolean hasChange = false;
if (lastOccluded != mOccluded) { if (lastOccluded != mOccluded) {
if (mDisplayId == DEFAULT_DISPLAY) {
EventLogTags.writeWmSetKeyguardShown(
mDisplayId,
mKeyguardShowing ? 1 : 0,
mAodShowing ? 1 : 0,
mKeyguardGoingAway ? 1 : 0,
mOccluded ? 1 : 0,
"updateVisibility");
}
controller.handleOccludedChanged(mDisplayId, mTopOccludesActivity); controller.handleOccludedChanged(mDisplayId, mTopOccludesActivity);
hasChange = true; hasChange = true;
} else if (!lastKeyguardGoingAway && mKeyguardGoingAway) { } else if (!lastKeyguardGoingAway && mKeyguardGoingAway) {

View File

@@ -16,6 +16,8 @@
package com.android.server.wm; package com.android.server.wm;
import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_REMOTE_ANIMATIONS; import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_REMOTE_ANIMATIONS;
import static com.android.server.wm.AnimationAdapterProto.REMOTE; import static com.android.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET; import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
@@ -195,6 +197,13 @@ class RemoteAnimationController implements DeathRecipient {
+ " transit=%s, apps=%d, wallpapers=%d, nonApps=%d", + " transit=%s, apps=%d, wallpapers=%d, nonApps=%d",
AppTransition.appTransitionOldToString(transit), appTargets.length, AppTransition.appTransitionOldToString(transit), appTargets.length,
wallpaperTargets.length, nonAppTargets.length); wallpaperTargets.length, nonAppTargets.length);
if (AppTransition.isKeyguardOccludeTransitOld(transit)) {
EventLogTags.writeWmSetKeyguardOccluded(
transit == TRANSIT_OLD_KEYGUARD_UNOCCLUDE ? 0 : 1,
1 /* animate */,
transit,
"onAnimationStart");
}
mRemoteAnimationAdapter.getRunner().onAnimationStart(transit, appTargets, mRemoteAnimationAdapter.getRunner().onAnimationStart(transit, appTargets,
wallpaperTargets, nonAppTargets, mFinishedCallback); wallpaperTargets, nonAppTargets, mFinishedCallback);
} catch (RemoteException e) { } catch (RemoteException e) {
@@ -356,6 +365,11 @@ class RemoteAnimationController implements DeathRecipient {
final boolean isKeyguardOccluded = mDisplayContent.isKeyguardOccluded(); final boolean isKeyguardOccluded = mDisplayContent.isKeyguardOccluded();
try { try {
EventLogTags.writeWmSetKeyguardOccluded(
isKeyguardOccluded ? 1 : 0,
0 /* animate */,
0 /* transit */,
"onAnimationCancelled");
mRemoteAnimationAdapter.getRunner().onAnimationCancelled(isKeyguardOccluded); mRemoteAnimationAdapter.getRunner().onAnimationCancelled(isKeyguardOccluded);
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.e(TAG, "Failed to notify cancel", e); Slog.e(TAG, "Failed to notify cancel", e);