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

Commit fd234402 authored by Wenyi Wang's avatar Wenyi Wang Committed by android-build-merger
Browse files

Consume KEYCODE_BACK event when drawer is open

am: ff3f119c

Change-Id: I1e9c4fe2d7ee8679e1c725fd36dcd304c8fa57ef
parents 7a51c3f3 ff3f119c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -760,9 +760,12 @@ public class PeopleActivity extends AppCompatContactsActivity implements

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        // Only consume the event if the drawer is closed. Otherwise, key events will activate
        // search mode when drawer is open.
        // If the drawer is open, consume KEYCODE_BACK event only.
        if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
            if (keyCode == KeyEvent.KEYCODE_BACK) {
                // Should eventually go to onBackPressed().
                return super.onKeyDown(keyCode, event);
            }
            return false;
        }
        // Bring up the search UI if the user starts typing