summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/InCallPresenter.java
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2014-02-27 10:49:20 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-27 10:49:20 -0800
commitff8c6974c421070d3e2d3490f5821ae642811d15 (patch)
tree46df1211c22595963644d81893b9e4e85e15c905 /InCallUI/src/com/android/incallui/InCallPresenter.java
parent1cd204555beea34d926a203e9b406357fdf746c5 (diff)
parent72aa15de5bb974c95db67f8d631f0e10007903fc (diff)
am d52e4929: add actions to the incoming call notification
* commit 'd52e4929af6e83e9fcb9ffef3f2f8c74a14e5aca': add actions to the incoming call notification
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallPresenter.java')
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 6260e9547..bc7c41a2c 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -368,6 +368,41 @@ public class InCallPresenter implements CallList.Listener {
}
/**
+ * Answers any incoming call.
+ */
+ public void answerIncomingCall(Context context) {
+ // By the time we receive this intent, we could be shut down and call list
+ // could be null. Bail in those cases.
+ if (mCallList == null) {
+ StatusBarNotifier.clearInCallNotification(context);
+ return;
+ }
+
+ Call call = mCallList.getIncomingCall();
+ if (call != null) {
+ CallCommandClient.getInstance().answerCall(call.getCallId());
+ showInCall(false);
+ }
+ }
+
+ /**
+ * Declines any incoming call.
+ */
+ public void declineIncomingCall(Context context) {
+ // By the time we receive this intent, we could be shut down and call list
+ // could be null. Bail in those cases.
+ if (mCallList == null) {
+ StatusBarNotifier.clearInCallNotification(context);
+ return;
+ }
+
+ Call call = mCallList.getIncomingCall();
+ if (call != null) {
+ CallCommandClient.getInstance().rejectCall(call, false, null);
+ }
+ }
+
+ /**
* Returns true if the incall app is the foreground application.
*/
public boolean isShowingInCallUi() {