summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-07-08 14:16:17 -0700
committerNancy Chen <nancychen@google.com>2014-07-17 10:19:20 -0700
commit5da0fd5e76794d415a9cfa501194980d5679eff6 (patch)
tree4478a9a56c2d11dea7fa7f6469ad06003cf9112d /telecomm
parent45374c9afad9ddc21966239d38823bd214145d24 (diff)
downloadframeworks_base-5da0fd5e76794d415a9cfa501194980d5679eff6.zip
frameworks_base-5da0fd5e76794d415a9cfa501194980d5679eff6.tar.gz
frameworks_base-5da0fd5e76794d415a9cfa501194980d5679eff6.tar.bz2
API changes to enable account selection for a call
If an account default is not set, the incall ui will display a dialog to allow the user to select an account for that particular call. Bug: 16243703 Change-Id: I8faf2f2ce0b2669a141562832f23e8f3ce88f094
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/Call.java16
-rw-r--r--telecomm/java/android/telecomm/CallState.java8
-rw-r--r--telecomm/java/android/telecomm/InCallAdapter.java13
-rw-r--r--telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl3
4 files changed, 40 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java
index 9f38d0d..5a41acb 100644
--- a/telecomm/java/android/telecomm/Call.java
+++ b/telecomm/java/android/telecomm/Call.java
@@ -62,6 +62,11 @@ public final class Call {
*/
public static final int STATE_DISCONNECTED = 7;
+ /**
+ * The state of an outgoing {@code Call}, but waiting for user input before proceeding.
+ */
+ public static final int STATE_PRE_DIAL_WAIT = 8;
+
public static class Details {
private final Uri mHandle;
private final int mHandlePresentation;
@@ -430,6 +435,15 @@ public final class Call {
}
/**
+ * Notifies this {@code Call} the a {@code PhoneAccount} has been selected and to proceed
+ * with placing an outgoing call.
+ */
+ public void phoneAccountSelected(PhoneAccount account) {
+ mInCallAdapter.phoneAccountSelected(mTelecommCallId, account);
+
+ }
+
+ /**
* Instructs this {@code Call} to enter a conference.
*/
public void conference() {
@@ -703,6 +717,8 @@ public final class Call {
switch (inCallCallState) {
case NEW:
return STATE_NEW;
+ case PRE_DIAL_WAIT:
+ return STATE_PRE_DIAL_WAIT;
case DIALING:
return STATE_DIALING;
case RINGING:
diff --git a/telecomm/java/android/telecomm/CallState.java b/telecomm/java/android/telecomm/CallState.java
index a464da5..7abf4ab 100644
--- a/telecomm/java/android/telecomm/CallState.java
+++ b/telecomm/java/android/telecomm/CallState.java
@@ -32,6 +32,14 @@ public enum CallState {
NEW,
/**
+ * Indicates that the call is about to go into the outgoing and dialing state but is waiting for
+ * user input before it proceeds. For example, where no default {@link PhoneAccount} is set,
+ * this is the state where the InCallUI is waiting for the user to select a {@link PhoneAccount}
+ * to call from.
+ */
+ PRE_DIAL_WAIT,
+
+ /**
* Indicates that a call is outgoing and in the dialing state. A call transitions to this state
* once an outgoing call has begun (e.g., user presses the dial button in Dialer). Calls in this
* state usually transition to {@link #ACTIVE} if the call was answered or {@link #DISCONNECTED}
diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java
index 66cf1df..f228046 100644
--- a/telecomm/java/android/telecomm/InCallAdapter.java
+++ b/telecomm/java/android/telecomm/InCallAdapter.java
@@ -200,6 +200,19 @@ public final class InCallAdapter {
}
/**
+ * Instructs Telecomm to add a PhoneAccount to the specified call
+ *
+ * @param callId The identifier of the call
+ * @param account The PhoneAccount through which to place the call
+ */
+ public void phoneAccountSelected(String callId, PhoneAccount account) {
+ try {
+ mAdapter.phoneAccountSelected(callId, account);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
* Instructs Telecomm to conference the specified call.
*
* @param callId The unique ID of the call.
diff --git a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
index ce0309f..b5b239b 100644
--- a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
@@ -17,6 +17,7 @@
package com.android.internal.telecomm;
import android.telecomm.CallAudioState;
+import android.telecomm.PhoneAccount;
/**
* Internal remote callback interface for in-call services.
@@ -48,6 +49,8 @@ oneway interface IInCallAdapter {
void phoneAccountClicked(String callId);
+ void phoneAccountSelected(String callId, in PhoneAccount account);
+
void conference(String callId);
void splitFromConference(String callId);