Wire KEYCODE_SYSRQ up to take screenshot.

Change-Id: If7eee811d43ac88c7d206c61f264c3e5f63aa5b3
This commit is contained in:
Jeff Sharkey
2012-12-05 18:06:43 -08:00
parent e81f55bae8
commit 2991fa35a5

View File

@@ -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