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

Commit ad0118a3 authored by Robin Lee's avatar Robin Lee
Browse files

Show work unlock prompt on focus as well as touch

With change I4576aaafa141ef5297f9c18935b747693a80f0fd we can be
reasonably sure this isn't going to instantly bring the prompt into
fullscreen, since launching this activity as an overlay in an
unfocused task won't bring it to the front.

But if it's launched in a focused task, it will get focused and
brought to the front, starting the unlock process. This saves us a
click, and user frustration, and is generally a good thing.

Bug: 31001762
Test: //tests/PoApi/src/com/google/android/afwtest/poapi/WorkChallengeTest (harness)
Change-Id: Ic5a33589e2b63d04e47c5f166da0077188cb55ea
parent 3101b3ad
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -100,11 +100,19 @@ public class WorkLockActivity extends Activity {
        final View blankView = new View(this);
        blankView.setBackgroundColor(color);
        setContentView(blankView);
    }

        // Respond to input events by showing the prompt to confirm credentials.
        blankView.setOnClickListener((View v) -> {
    /**
     * Respond to focus events by showing the prompt to confirm credentials.
     * <p>
     * We don't have anything particularly interesting to show here (just a solid-colored page) so
     * there is no sense in sitting in the foreground doing nothing.
     */
    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        if (hasFocus) {
            showConfirmCredentialActivity();
        });
        }
    }

    @Override