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

Commit d6e25d49 authored by Alison Cichowlas's avatar Alison Cichowlas Committed by Android (Google) Code Review
Browse files

Merge "Add a flag to change the screenshot keychord delay" into rvc-qpr-dev

parents 1c62ec88 488f0a68
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -409,6 +409,11 @@ public final class SystemUiDeviceConfigFlags {
     */
     */
    public static final String BACK_GESTURE_SLOP_MULTIPLIER = "back_gesture_slop_multiplier";
    public static final String BACK_GESTURE_SLOP_MULTIPLIER = "back_gesture_slop_multiplier";


    /**
     * (long) Screenshot keychord delay (how long the buttons must be pressed), in ms
     */
    public static final String SCREENSHOT_KEYCHORD_DELAY = "screenshot_keychord_delay";

    private SystemUiDeviceConfigFlags() {
    private SystemUiDeviceConfigFlags() {
    }
    }
}
}
+7 −3
Original line number Original line Diff line number Diff line
@@ -69,6 +69,7 @@ import static android.view.WindowManager.TAKE_SCREENSHOT_SELECTED_REGION;
import static android.view.WindowManagerGlobal.ADD_OKAY;
import static android.view.WindowManagerGlobal.ADD_OKAY;
import static android.view.WindowManagerGlobal.ADD_PERMISSION_DENIED;
import static android.view.WindowManagerGlobal.ADD_PERMISSION_DENIED;


import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.SCREENSHOT_KEYCHORD_DELAY;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.CAMERA_LENS_COVERED;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.CAMERA_LENS_COVERED;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.CAMERA_LENS_COVER_ABSENT;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.CAMERA_LENS_COVER_ABSENT;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.CAMERA_LENS_UNCOVERED;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.CAMERA_LENS_UNCOVERED;
@@ -148,6 +149,7 @@ import android.os.UEventObserver;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.VibrationEffect;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.os.Vibrator;
import android.provider.DeviceConfig;
import android.provider.MediaStore;
import android.provider.MediaStore;
import android.provider.Settings;
import android.provider.Settings;
import android.service.dreams.DreamManagerInternal;
import android.service.dreams.DreamManagerInternal;
@@ -1379,12 +1381,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }
    }


    private long getScreenshotChordLongPressDelay() {
    private long getScreenshotChordLongPressDelay() {
        long delayMs = DeviceConfig.getLong(
                DeviceConfig.NAMESPACE_SYSTEMUI, SCREENSHOT_KEYCHORD_DELAY,
                ViewConfiguration.get(mContext).getScreenshotChordKeyTimeout());
        if (mKeyguardDelegate.isShowing()) {
        if (mKeyguardDelegate.isShowing()) {
            // Double the time it takes to take a screenshot from the keyguard
            // Double the time it takes to take a screenshot from the keyguard
            return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER *
            return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER * delayMs);
                    ViewConfiguration.get(mContext).getScreenshotChordKeyTimeout());
        }
        }
        return ViewConfiguration.get(mContext).getScreenshotChordKeyTimeout();
        return delayMs;
    }
    }


    private long getRingerToggleChordDelay() {
    private long getRingerToggleChordDelay() {