Merge "Wire KEYCODE_SYSRQ up to take screenshot."

This commit is contained in:
Jeff Sharkey
2012-12-06 09:35:40 -08:00
committed by Android (Google) Code Review

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