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

Commit d3a28d02 authored by Benjamin Gordon's avatar Benjamin Gordon
Browse files

Cancel printing with escape key

When an external keyboard is attached, users expect to be able to cancel
dialogs with the Escape key.  Since PrintSpooler already handles this
behavior when the Back key is pressed, simply give the Escape key the
same behavior.

Bug: 364883486
Flag: EXEMPT bug fix
Test: Manual comparison of ESC and Back on a keyboard with both
Change-Id: I3e54deb1a1cb781fe1d54ea4e19e4476d423e339
parent c8599b4e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
        if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) {
            event.startTracking();
            return true;
        }
@@ -479,7 +479,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
            return true;
        }

        if (keyCode == KeyEvent.KEYCODE_BACK
        if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE)
                && event.isTracking() && !event.isCanceled()) {
            if (mPrintPreviewController != null && mPrintPreviewController.isOptionsOpened()
                    && !hasErrors()) {