diff options
author | Santos Cordon <santoscordon@google.com> | 2013-09-19 03:23:03 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2013-09-19 03:23:03 -0700 |
commit | 2acdea2c70d7fc470509b8d6ac3c5e7273544bea (patch) | |
tree | a0a03072be5c21771fe0d4e2cb41b54d000b8bec /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | c45651f66d67ad0ff33c302ae2c350bfdd4fe7d1 (diff) |
Add support for hardware CALL button.
bug:10809304
Change-Id: I8b6c5e27a37624f38df965e2ad001703cf558708
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index feb3ec137..17b4c31fd 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -190,7 +190,10 @@ public class InCallActivity extends Activity { public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_CALL: - // TODO(klp): handle call key + boolean handled = InCallPresenter.getInstance().handleCallKey(); + if (!handled) { + Log.w(this, "InCallActivity should always handle KEYCODE_CALL in onKeyDown"); + } // Always consume CALL to be sure the PhoneWindow won't do anything with it return true; @@ -209,11 +212,12 @@ public class InCallActivity extends Activity { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: - // Not sure if needed. If so, silence ringer. + // Ringer silencing handled by PhoneWindowManager. break; case KeyEvent.KEYCODE_MUTE: - toast("mute"); + // toggle mute + CallCommandClient.getInstance().mute(!AudioModeProvider.getInstance().getMute()); return true; // Various testing/debugging features, enabled ONLY when VERBOSE == true. @@ -228,11 +232,10 @@ public class InCallActivity extends Activity { } break; case KeyEvent.KEYCODE_EQUALS: - // TODO(klp): Dump phone state? + // TODO: Dump phone state? break; } - // TODO(klp) Adds hardware keyboard support return super.onKeyDown(keyCode, event); } |