"Add" enable video call setting to call settings.
+ Add in the sense that it is implemented, although it is always
removed for now. Further work needs to be done to condition the
display of this setting on VoLTE support.
+ Make PhoneInterfaceManager's storage of shared preferences more
generic. Add a key to store whether video calling is enabled.
+ Add "Turn on video calling" option to call settings, and update
the share preference when changed.
Bug: 16014284
Change-Id: Id6ac1f55b3933c33f8653622ae0fea961d1644eb
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index f9a0989..ffbdebf 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -136,11 +136,12 @@
AppOpsManager mAppOps;
MainThreadHandler mMainThreadHandler;
- SharedPreferences carrierPrivilegeConfigs;
+ SharedPreferences mTelephonySharedPreferences;
private static final String PREF_CARRIERS_ALPHATAG_PREFIX = "carrier_alphtag_";
private static final String PREF_CARRIERS_NUMBER_PREFIX = "carrier_number_";
private static final String PREF_CARRIERS_SIMPLIFIED_NETWORK_SETTINGS_PREFIX =
"carrier_simplified_network_settings_";
+ private static final String PREF_ENABLE_VIDEO_CALLING = "enable_video_calling";
/**
* A request object to use for transmitting data to an ICC.
@@ -703,7 +704,7 @@
mCM = PhoneGlobals.getInstance().mCM;
mAppOps = (AppOpsManager)app.getSystemService(Context.APP_OPS_SERVICE);
mMainThreadHandler = new MainThreadHandler();
- carrierPrivilegeConfigs =
+ mTelephonySharedPreferences =
PreferenceManager.getDefaultSharedPreferences(mPhone.getContext());
publish();
}
@@ -1947,7 +1948,7 @@
String iccId = getIccId(subId);
if (iccId != null) {
String snsPrefKey = PREF_CARRIERS_SIMPLIFIED_NETWORK_SETTINGS_PREFIX + iccId;
- SharedPreferences.Editor editor = carrierPrivilegeConfigs.edit();
+ SharedPreferences.Editor editor = mTelephonySharedPreferences.edit();
if (enable) {
editor.putBoolean(snsPrefKey, true);
} else {
@@ -1963,7 +1964,7 @@
String iccId = getIccId(subId);
if (iccId != null) {
String snsPrefKey = PREF_CARRIERS_SIMPLIFIED_NETWORK_SETTINGS_PREFIX + iccId;
- return carrierPrivilegeConfigs.getBoolean(snsPrefKey, false);
+ return mTelephonySharedPreferences.getBoolean(snsPrefKey, false);
}
return false;
}
@@ -1975,7 +1976,7 @@
String iccId = getIccId(subId);
if (iccId != null) {
String alphaTagPrefKey = PREF_CARRIERS_ALPHATAG_PREFIX + iccId;
- SharedPreferences.Editor editor = carrierPrivilegeConfigs.edit();
+ SharedPreferences.Editor editor = mTelephonySharedPreferences.edit();
if (alphaTag == null) {
editor.remove(alphaTagPrefKey);
} else {
@@ -1999,7 +2000,7 @@
String iccId = getIccId(subId);
if (iccId != null) {
String numberPrefKey = PREF_CARRIERS_NUMBER_PREFIX + iccId;
- return carrierPrivilegeConfigs.getString(numberPrefKey, null);
+ return mTelephonySharedPreferences.getString(numberPrefKey, null);
}
return null;
}
@@ -2011,7 +2012,7 @@
String iccId = getIccId(subId);
if (iccId != null) {
String alphaTagPrefKey = PREF_CARRIERS_ALPHATAG_PREFIX + iccId;
- return carrierPrivilegeConfigs.getString(alphaTagPrefKey, null);
+ return mTelephonySharedPreferences.getString(alphaTagPrefKey, null);
}
return null;
}
@@ -2067,4 +2068,18 @@
public int getRadioAccessFamily(int phoneId) {
return ProxyController.getInstance().getRadioAccessFamily(phoneId);
}
+
+ @Override
+ public void enableVideoCalling(boolean enable) {
+ enforceModifyPermission();
+ SharedPreferences.Editor editor = mTelephonySharedPreferences.edit();
+ editor.putBoolean(PREF_ENABLE_VIDEO_CALLING, enable);
+ editor.commit();
+ }
+
+ @Override
+ public boolean isVideoCallingEnabled() {
+ enforceReadPermission();
+ return mTelephonySharedPreferences.getBoolean(PREF_ENABLE_VIDEO_CALLING, true);
+ }
}