summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2014-07-09 04:31:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-08 21:53:37 +0000
commit24ae29623faf46a22f0f4e849d45d6b1933fd194 (patch)
treebe8bac08af27b9e6936832d6330f1729b14fce28 /telecomm
parentb06448abf9d92e3e2bccaca6bdfe6a0219af6a47 (diff)
parent33aaae4a07fdcce223fe74d96d751f4bffa6723a (diff)
downloadframeworks_base-24ae29623faf46a22f0f4e849d45d6b1933fd194.zip
frameworks_base-24ae29623faf46a22f0f4e849d45d6b1933fd194.tar.gz
frameworks_base-24ae29623faf46a22f0f4e849d45d6b1933fd194.tar.bz2
Merge "Add Connection.setAudioModeIsVoip"
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/Connection.java24
-rw-r--r--telecomm/java/android/telecomm/ConnectionService.java6
-rw-r--r--telecomm/java/android/telecomm/ConnectionServiceAdapter.java15
-rw-r--r--telecomm/java/android/telecomm/RemoteConnection.java14
-rw-r--r--telecomm/java/android/telecomm/RemoteConnectionService.java8
-rw-r--r--telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl2
6 files changed, 69 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index c55e5ab..213c3c5 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -44,6 +44,7 @@ public abstract class Connection {
void onConferenceCapableChanged(Connection c, boolean isConferenceCapable);
void onParentConnectionChanged(Connection c, Connection parent);
void onSetCallVideoProvider(Connection c, CallVideoProvider callVideoProvider);
+ void onSetAudioModeIsVoip(Connection c, boolean isVoip);
}
/** @hide */
@@ -81,6 +82,9 @@ public abstract class Connection {
@Override
public void onSetCallVideoProvider(Connection c, CallVideoProvider callVideoProvider) {}
+
+ @Override
+ public void onSetAudioModeIsVoip(Connection c, boolean isVoip) {}
}
public final class State {
@@ -104,6 +108,7 @@ public abstract class Connection {
private boolean mRequestingRingback = false;
private boolean mIsConferenceCapable = false;
private Connection mParentConnection;
+ private boolean mAudioModeIsVoip;
/**
* Create a new Connection.
@@ -165,6 +170,13 @@ public abstract class Connection {
}
/**
+ * @return True if the connection's audio mode is VOIP.
+ */
+ public final boolean getAudioModeIsVoip() {
+ return mAudioModeIsVoip;
+ }
+
+ /**
* Assign a listener to be notified of state changes.
*
* @param l A listener.
@@ -408,6 +420,18 @@ public abstract class Connection {
}
/**
+ * Requests that the framework use VOIP audio mode for this connection.
+ *
+ * @param isVoip True if the audio mode is VOIP.
+ */
+ public final void setAudioModeIsVoip(boolean isVoip) {
+ mAudioModeIsVoip = isVoip;
+ for (Listener l : mListeners) {
+ l.onSetAudioModeIsVoip(this, isVoip);
+ }
+ }
+
+ /**
* Notifies this Connection and listeners that the {@link #getCallAudioState()} property
* has a new value.
*
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 3b763957..ba71c06 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -364,6 +364,12 @@ public abstract class ConnectionService extends Service {
String id = mIdByConnection.get(c);
mAdapter.setCallVideoProvider(id, callVideoProvider);
}
+
+ @Override
+ public void onSetAudioModeIsVoip(Connection c, boolean isVoip) {
+ String id = mIdByConnection.get(c);
+ mAdapter.setAudioModeIsVoip(id, isVoip);
+ }
};
/** {@inheritDoc} */
diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
index 1d21888..8733316 100644
--- a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
@@ -321,6 +321,21 @@ final class ConnectionServiceAdapter implements DeathRecipient {
}
/**
+ * Requests that the framework use VOIP audio mode for this connection.
+ *
+ * @param callId The unique ID of the call to set with the given call video provider.
+ * @param isVoip True if the audio mode is VOIP.
+ */
+ void setAudioModeIsVoip(String callId, boolean isVoip) {
+ for (IConnectionServiceAdapter adapter : mAdapters) {
+ try {
+ adapter.setAudioModeIsVoip(callId, isVoip);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
* Set the features associated with the given call.
* Features are defined in {@link android.telecomm.CallFeatures} and are passed in as a
* bit-mask.
diff --git a/telecomm/java/android/telecomm/RemoteConnection.java b/telecomm/java/android/telecomm/RemoteConnection.java
index 18df37d..2213abe 100644
--- a/telecomm/java/android/telecomm/RemoteConnection.java
+++ b/telecomm/java/android/telecomm/RemoteConnection.java
@@ -37,6 +37,7 @@ public final class RemoteConnection {
void onRequestingRingback(RemoteConnection connection, boolean ringback);
void onPostDialWait(RemoteConnection connection, String remainingDigits);
void onFeaturesChanged(RemoteConnection connection, int features);
+ void onSetAudioModeIsVoip(RemoteConnection connection, boolean isVoip);
void onDestroyed(RemoteConnection connection);
}
@@ -50,6 +51,7 @@ public final class RemoteConnection {
private boolean mRequestingRingback;
private boolean mConnected;
private int mFeatures;
+ private boolean mAudioModeIsVoip;
/**
* @hide
@@ -85,6 +87,10 @@ public final class RemoteConnection {
return mFeatures;
}
+ public boolean getAudioModeIsVoip() {
+ return mAudioModeIsVoip;
+ }
+
public void abort() {
try {
if (mConnected) {
@@ -252,4 +258,12 @@ public final class RemoteConnection {
l.onFeaturesChanged(this, features);
}
}
+
+ /** @hide */
+ void setAudioModeIsVoip(boolean isVoip) {
+ mAudioModeIsVoip = isVoip;
+ for (Listener l : mListeners) {
+ l.onSetAudioModeIsVoip(this, isVoip);
+ }
+ }
}
diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java
index 4f4941d..0b95f52 100644
--- a/telecomm/java/android/telecomm/RemoteConnectionService.java
+++ b/telecomm/java/android/telecomm/RemoteConnectionService.java
@@ -193,6 +193,14 @@ final class RemoteConnectionService implements DeathRecipient {
mConnection.setFeatures(features);
}
}
+
+ /** ${inheritDoc} */
+ @Override
+ public final void setAudioModeIsVoip(String connectionId, boolean isVoip) {
+ if (isCurrentConnection(connectionId)) {
+ mConnection.setAudioModeIsVoip(isVoip);
+ }
+ }
};
RemoteConnectionService(ComponentName componentName, IConnectionService connectionService)
diff --git a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
index 9acc920..29f62b4 100644
--- a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
@@ -64,4 +64,6 @@ oneway interface IConnectionServiceAdapter {
void setCallVideoProvider(String callId, ICallVideoProvider callVideoProvider);
void setFeatures(String callId, int features);
+
+ void setAudioModeIsVoip(String callId, boolean isVoip);
}