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

Commit 5390be36 authored by Ioannis Ilkos's avatar Ioannis Ilkos
Browse files

Add tracepoint for gesture navigation launching the camera

Bug: b/133145601
Test: N/A
Change-Id: I6f3f2d9508f01bff9eb2014701913c921ff830b8
parent 8600673c
Loading
Loading
Loading
Loading
+28 −18
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.MutableBoolean;
@@ -404,17 +405,23 @@ public class GestureLauncherService extends SystemService {
     */
    @VisibleForTesting
    boolean handleCameraGesture(boolean useWakelock, int source) {
        Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "GestureLauncher:handleCameraGesture");
        try {
            boolean userSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                    Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
            if (!userSetupComplete) {
            if (DBG) Slog.d(TAG, String.format(
                if (DBG) {
                    Slog.d(TAG, String.format(
                            "userSetupComplete = %s, ignoring camera gesture.",
                            userSetupComplete));
                }
                return false;
            }
        if (DBG) Slog.d(TAG, String.format(
            if (DBG) {
                Slog.d(TAG, String.format(
                        "userSetupComplete = %s, performing camera gesture.",
                        userSetupComplete));
            }

            if (useWakelock) {
                // Make sure we don't sleep too early
@@ -424,6 +431,9 @@ public class GestureLauncherService extends SystemService {
                    StatusBarManagerInternal.class);
            service.onCameraLaunchGestureDetected(source);
            return true;
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
        }
    }

    private final BroadcastReceiver mUserReceiver = new BroadcastReceiver() {