summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2014-02-11 22:32:21 -0800
committerSailesh Nepal <sail@google.com>2014-02-11 22:32:21 -0800
commit1bd7876d76167922f38d78747c5696c82020c1ea (patch)
treeda9b5857b68001bb0786d57bd0d59aad0457d020 /telephony
parent512b28309d3ee5dd506e62fb14913047b6049236 (diff)
downloadframeworks_base-1bd7876d76167922f38d78747c5696c82020c1ea.zip
frameworks_base-1bd7876d76167922f38d78747c5696c82020c1ea.tar.gz
frameworks_base-1bd7876d76167922f38d78747c5696c82020c1ea.tar.bz2
Add Wi-Fi calling state setting to telephony interfaces
Change-Id: I01029ade0eb1ff981cb92a536d042a02129a053f
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java40
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl14
2 files changed, 54 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 0e54d0f..5902b9c 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -62,6 +62,20 @@ public class TelephonyManager {
private static ITelephonyRegistry sRegistry;
private final Context mContext;
+ /**
+ * The allowed states of Wi-Fi calling.
+ *
+ * @hide
+ */
+ public interface WifiCallingChoices {
+ /** Always use Wi-Fi calling */
+ static final int ALWAYS_USE = 0;
+ /** Never use Wi-Fi calling */
+ static final int NEVER_USE = 1;
+ /** Ask the user whether to use Wi-Fi on every call */
+ static final int ASK_EVERY_TIME = 2;
+ }
+
/** @hide */
public TelephonyManager(Context context) {
Context appContext = context.getApplicationContext();
@@ -1617,5 +1631,31 @@ public class TelephonyManager {
Rlog.e(TAG, "setRadioMode NPE", ex);
}
return false;
+
+ /*
+ * Obtain the current state of Wi-Fi calling.
+ *
+ * @hide
+ * @see android.telephony.TelephonyManager.WifiCallingChoices
+ */
+ public int getWhenToMakeWifiCalls() {
+ try {
+ return getITelephony().getWhenToMakeWifiCalls();
+ } catch (RemoteException ex) {
+ return WifiCallingChoices.NEVER_USE;
+ }
+ }
+
+ /**
+ * Set the current state of Wi-Fi calling.
+ *
+ * @hide
+ * @see android.telephony.TelephonyManager.WifiCallingChoices
+ */
+ public void setWhenToMakeWifiCalls(int state) {
+ try {
+ getITelephony().setWhenToMakeWifiCalls(state);
+ } catch (RemoteException ex) {
+ }
}
}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index a22e6b6..3ff5a52 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -425,4 +425,18 @@ interface ITelephony {
*/
void newIncomingThirdPartyCall(in ComponentName component, String callId,
String callerDisplayName);
+
+ /**
+ * Obtain the current state of Wi-Fi calling.
+ *
+ * @see android.telephony.TelephonyManager.WifiCallingChoices
+ */
+ int getWhenToMakeWifiCalls();
+
+ /**
+ * Set the current state of Wi-Fi calling.
+ *
+ * @see android.telephony.TelephonyManager.WifiCallingChoices
+ */
+ void setWhenToMakeWifiCalls(int state);
}