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

Commit 2991fa35 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Wire KEYCODE_SYSRQ up to take screenshot.

Change-Id: If7eee811d43ac88c7d206c61f264c3e5f63aa5b3
parent e81f55ba
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -684,7 +684,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                mVolumeDownKeyConsumedByScreenshotChord = true;
                cancelPendingPowerKeyAction();

                mHandler.postDelayed(mScreenshotChordLongPress, getScreenshotChordLongPressDelay());
                mHandler.postDelayed(mScreenshotRunnable, getScreenshotChordLongPressDelay());
            }
        }
    }
@@ -700,7 +700,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    private void cancelPendingScreenshotChordAction() {
        mHandler.removeCallbacks(mScreenshotChordLongPress);
        mHandler.removeCallbacks(mScreenshotRunnable);
    }

    private final Runnable mPowerLongPress = new Runnable() {
@@ -738,7 +738,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    };

    private final Runnable mScreenshotChordLongPress = new Runnable() {
    private final Runnable mScreenshotRunnable = new Runnable() {
        public void run() {
            takeScreenshot();
        }
@@ -1975,6 +1975,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
            }
            return -1;
        } else if (keyCode == KeyEvent.KEYCODE_SYSRQ) {
            if (down && repeatCount == 0) {
                mHandler.post(mScreenshotRunnable);
            }
            return -1;
        }

        // Shortcuts are invoked through Search+key, so intercept those here