Consume KEYCODE_BACK event when drawer is open

Bug: 34343480

Test: press non-arrow/tab keys when drawer is open and make sure
      search mode is not activated; press BACK button on phone or
      ESC button on physical keyboard when drawer is open and make
      sure drawer is closed.

Change-Id: Id9c584c4dff16afd9e6c50bfcad25ec6a4972105
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 84ddbd5..5a38043 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -760,9 +760,12 @@
 
     @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