Add Wi-Fi calling state setting to telephony interfaces
Change-Id: I843fc6de74c6dd2f1bafc9b1ed8ae3368d153a1e
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 9ad47ac..261e378 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -18,7 +18,6 @@
import android.app.ActivityManager;
import android.app.AppOpsManager;
-import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -33,9 +32,11 @@
import android.os.Process;
import android.os.ServiceManager;
import android.os.UserHandle;
+import android.provider.Settings;
import android.telephony.NeighboringCellInfo;
import android.telephony.CellInfo;
import android.telephony.ServiceState;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -945,4 +946,24 @@
public int getLteOnCdmaMode() {
return mPhone.getLteOnCdmaMode();
}
+
+ /**
+ * @see android.telephony.TelephonyManager.WifiCallingChoices
+ */
+ public int getWhenToMakeWifiCalls() {
+ try {
+ return Settings.System.getInt(mPhone.getContext().getContentResolver(),
+ Settings.System.WHEN_TO_MAKE_WIFI_CALLS);
+ } catch (Settings.SettingNotFoundException e) {
+ return TelephonyManager.WifiCallingChoices.NEVER_USE;
+ }
+ }
+
+ /**
+ * @see android.telephony.TelephonyManager.WifiCallingChoices
+ */
+ public void setWhenToMakeWifiCalls(int preference) {
+ Settings.System.putInt(mPhone.getContext().getContentResolver(),
+ Settings.System.WHEN_TO_MAKE_WIFI_CALLS, preference);
+ }
}