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

Commit 453e7c1c authored by Jason Monk's avatar Jason Monk
Browse files

Add latency logging for rotation

Move LatencyTracker and sysui_latency to make this possible

Fixes: 67862696
Test: atest
platform_testing/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/LatencyTests.java#testRotationLatency

Change-Id: I44ddbc625b8aba7b1d43858688349c9bfb0f9470
parent 5826e469
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -8,3 +8,8 @@ option java_package com.android.internal.logging;
524292 sysui_multi_action (content|4)
524290 sysui_count (name|3),(increment|1)
524291 sysui_histogram (name|3),(bucket|1)

# ---------------------------
# LatencyTracker.java
# ---------------------------
36070 sysui_latency (action|1|6),(latency|1|3)
+16 −12
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 * Unless required by applicable law or agreed to in writing, software distributed under the
 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.android.keyguard;
package com.android.internal.util;

import android.content.BroadcastReceiver;
import android.content.Context;
@@ -28,7 +26,7 @@ import android.util.EventLog;
import android.util.Log;
import android.util.SparseLongArray;

import com.android.systemui.EventLogTags;
import com.android.internal.logging.EventLogTags;

/**
 * Class to track various latencies in SystemUI. It then outputs the latency to logcat so these
@@ -76,13 +74,19 @@ public class LatencyTracker {
     */
    public static final int ACTION_TURN_ON_SCREEN = 5;

    /**
     * Time it takes to rotate the screen.
     */
    public static final int ACTION_ROTATE_SCREEN = 6;

    private static final String[] NAMES = new String[] {
            "expand panel",
            "toggle recents",
            "fingerprint wake-and-unlock",
            "check credential",
            "check credential unlocked",
            "turn on screen" };
            "turn on screen",
            "rotate the screen"};

    private static LatencyTracker sLatencyTracker;

+3 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

package com.android.keyguard;

import static com.android.keyguard.LatencyTracker.ACTION_CHECK_CREDENTIAL;
import static com.android.keyguard.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED;
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL;
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED;

import android.content.Context;
import android.os.AsyncTask;
@@ -29,6 +29,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;

import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternChecker;
import com.android.internal.widget.LockPatternUtils;

+3 −2
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@
 */
package com.android.keyguard;

import static com.android.keyguard.LatencyTracker.ACTION_CHECK_CREDENTIAL;
import static com.android.keyguard.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED;
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL;
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED;

import android.content.Context;
import android.graphics.Rect;
@@ -33,6 +33,7 @@ import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.LinearLayout;

import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternChecker;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockPatternView;
+0 −5
Original line number Diff line number Diff line
@@ -61,8 +61,3 @@ option java_package com.android.systemui;
##       4: SYSTEM_REGISTER_USER     System sysui registers user's callbacks
##       5: SYSTEM_UNREGISTER_USER   System sysui unregisters user's callbacks (after death)
36060 sysui_recents_connection (type|1),(user|1)

# ---------------------------
# LatencyTracker.java
# ---------------------------
36070 sysui_latency (action|1|5),(latency|1|3)
Loading