Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2e7e5a2 authored by Issei Suzuki's avatar Issei Suzuki
Browse files

Add event log for keyguard occlude status chagne.

Bug: 271433779
Bug: 269892931
Test: adb logcat -b events
Merged-In: Id32e7db9d2147e4a5458dd313edfd453ade74d51
Change-Id: Id32e7db9d2147e4a5458dd313edfd453ade74d51
parent 1112655d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.internal.policy.IKeyguardExitCallback;
import com.android.internal.policy.IKeyguardService;
import com.android.server.UiThread;
import com.android.server.policy.WindowManagerPolicy.OnKeyguardExitResult;
import com.android.server.wm.EventLogTags;

import java.io.PrintWriter;

@@ -257,6 +258,11 @@ public class KeyguardServiceDelegate {
    public void setOccluded(boolean isOccluded, boolean animate, boolean notify) {
        if (mKeyguardService != null && notify) {
            if (DEBUG) Log.v(TAG, "setOccluded(" + isOccluded + ") animate=" + animate);
            EventLogTags.writeWmSetKeyguardOccluded(
                    isOccluded ? 1 : 0,
                    animate ? 1 : 0,
                    0 /* transit */,
                    "setOccluded");
            mKeyguardService.setOccluded(isOccluded, animate);
        }
        mKeyguardState.occluded = isOccluded;
+3 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ option java_package com.android.server.wm
30066 wm_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3)

# 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.
31000 wm_no_surface_memory (Window|3),(PID|1|5),(Operation|3)
@@ -64,6 +64,8 @@ option java_package com.android.server.wm
31003 wm_task_removed (TaskId|1|5),(Reason|3)
# bootanim finished:
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)

# Request surface flinger to show / hide the wallpaper surface.
33001 wm_wallpaper_surface (Display Id|1|5),(Visible|1),(Target|3)
+12 −1
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ class KeyguardController {
                keyguardShowing ? 1 : 0,
                aodShowing ? 1 : 0,
                state.mKeyguardGoingAway ? 1 : 0,
                state.mOccluded ? 1 : 0,
                "setKeyguardShown");

        // Update the task snapshot if the screen will not be turned off. To make sure that the
@@ -255,9 +256,10 @@ class KeyguardController {
        try {
            EventLogTags.writeWmSetKeyguardShown(
                    displayId,
                    1 /* keyguardShowing */,
                    state.mKeyguardShowing ? 1 : 0,
                    state.mAodShowing ? 1 : 0,
                    1 /* keyguardGoingAway */,
                    state.mOccluded ? 1 : 0,
                    "keyguardGoingAway");
            final int transitFlags = convertTransitFlags(flags);
            final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
@@ -671,6 +673,15 @@ class KeyguardController {

            boolean hasChange = false;
            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);
                hasChange = true;
            } else if (!lastKeyguardGoingAway && mKeyguardGoingAway) {
+14 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

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.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
@@ -194,6 +196,13 @@ class RemoteAnimationController implements DeathRecipient {
                                + " transit=%s, apps=%d, wallpapers=%d, nonApps=%d",
                        AppTransition.appTransitionOldToString(transit), appTargets.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,
                        wallpaperTargets, nonAppTargets, mFinishedCallback);
            } catch (RemoteException e) {
@@ -353,6 +362,11 @@ class RemoteAnimationController implements DeathRecipient {
        final boolean isKeyguardOccluded = mDisplayContent.isKeyguardOccluded();

        try {
            EventLogTags.writeWmSetKeyguardOccluded(
                    isKeyguardOccluded ? 1 : 0,
                    0 /* animate */,
                    0 /* transit */,
                    "onAnimationCancelled");
            mRemoteAnimationAdapter.getRunner().onAnimationCancelled(isKeyguardOccluded);
        } catch (RemoteException e) {
            Slog.e(TAG, "Failed to notify cancel", e);