summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-19 14:44:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-19 14:44:06 +0000
commit11ad8accee6284531eb6fd038ea5d44ba4e235d4 (patch)
treec0dbcfc9389ff07860893786ce259e6d46c1b399
parent82d64da6612291b8a73db8e452c0b3a1c26abf92 (diff)
parent955fa3870cae1a2bddfe4af9941052b9044f946f (diff)
Merge "Hide home and back buttons during incoming call" into klp-dev
-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 8c52aab2c..be77e1794 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);
}