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

Commit 36b78919 authored by Ioannis Ilkos's avatar Ioannis Ilkos Committed by android-build-merger
Browse files

Merge "Add tracepoint for gesture navigation launching the camera" into qt-dev

am: c543913a

Change-Id: I99a24a7722e63d846a9bede346935965b146335f
parents 7b44dba9 c543913a
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() {