summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-18 15:51:45 -0700
committerYorke Lee <yorkelee@google.com>2013-09-18 17:14:34 -0700
commit955fa3870cae1a2bddfe4af9941052b9044f946f (patch)
treedac631303941a915b9eedf97a4c093a8c982fb48 /InCallUI
parentc45651f66d67ad0ff33c302ae2c350bfdd4fe7d1 (diff)
Hide home and back buttons during incoming call
Bug: 10692603 Change-Id: I9bacaf39d926b9004778b33c33420a51dde1332f
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallCommandClient.java13
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java11
2 files changed, 24 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCommandClient.java b/InCallUI/src/com/android/incallui/CallCommandClient.java
index cb49dca8e..3f4ee7781 100644
--- a/InCallUI/src/com/android/incallui/CallCommandClient.java
+++ b/InCallUI/src/com/android/incallui/CallCommandClient.java
@@ -227,4 +227,17 @@ public class CallCommandClient {
}
}
+ public void setSystemBarNavigationEnabled(boolean enable) {
+ if (mCommandService == null) {
+ Log.e(this, "Cannot setSystemBarNavigationEnabled(); CallCommandService == null");
+ return;
+ }
+ try {
+ Log.v(this, "setSystemBarNavigationEnabled() enabled = " + enable);
+ mCommandService.setSystemBarNavigationEnabled(enable);
+ } catch (RemoteException e) {
+ Log.d(this, "Error on setSystemBarNavigationEnabled().");
+ }
+ }
+
}
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index bfff83fe5..d36be3e7b 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -183,6 +183,12 @@ public class InCallPresenter implements CallList.Listener {
InCallState newState = getPotentialStateFromCallList(callList);
newState = startOrFinishUi(newState);
+ // Renable notification shade and soft navigation buttons, if we are no longer in the
+ // incoming call screen
+ if (!newState.isIncoming()) {
+ CallCommandClient.getInstance().setSystemBarNavigationEnabled(true);
+ }
+
// Set the new state before announcing it to the world
Log.i(this, "Phone switching state: " + mInCallState + " -> " + newState);
mInCallState = newState;
@@ -206,6 +212,11 @@ public class InCallPresenter implements CallList.Listener {
Log.i(this, "Phone switching state: " + mInCallState + " -> " + newState);
mInCallState = newState;
+ // Disable notification shade and soft navigation buttons
+ if (newState.isIncoming()) {
+ CallCommandClient.getInstance().setSystemBarNavigationEnabled(false);
+ }
+
for (IncomingCallListener listener : mIncomingCallListeners) {
listener.onIncomingCall(mInCallState, call);
}