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

Commit c543913a authored by Ioannis Ilkos's avatar Ioannis Ilkos Committed by Android (Google) Code Review
Browse files

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

parents f6ca3f4e 5390be36
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() {