Remove WFC Roaming setting
Bug 19682545 Change-Id: I0adc7a20c411dd1fea3e2b79bcd5e159537a65c0
This commit is contained in:
@@ -1908,10 +1908,6 @@
|
|||||||
<string name="wfc_mode_cellular_preferred_summary">Cellular preferred (Uses Wi-Fi only if cell network isn\'t available)</string>
|
<string name="wfc_mode_cellular_preferred_summary">Cellular preferred (Uses Wi-Fi only if cell network isn\'t available)</string>
|
||||||
<!-- WFC, summary for Wi-Fi Only [CHAR LIMIT=100] -->
|
<!-- WFC, summary for Wi-Fi Only [CHAR LIMIT=100] -->
|
||||||
<string name="wfc_mode_wifi_only_summary">Wi-Fi only (Never uses cell network. Can\'t make or receive calls if Wi-Fi isn\'t available)</string>
|
<string name="wfc_mode_wifi_only_summary">Wi-Fi only (Never uses cell network. Can\'t make or receive calls if Wi-Fi isn\'t available)</string>
|
||||||
<!-- WFC roam enable/disable [CHAR LIMIT=30] -->
|
|
||||||
<string name="wifi_calling_roam_title">WFC handoff while roaming</string>
|
|
||||||
<!-- WFC roam summary [CHAR LIMIT=80] -->
|
|
||||||
<string name="wifi_calling_roam_summary">Allow Wi-Fi voice calls handoff to cell network when roaming</string>
|
|
||||||
|
|
||||||
<!-- Sound and alerts settings -->
|
<!-- Sound and alerts settings -->
|
||||||
<skip/>
|
<skip/>
|
||||||
|
|||||||
@@ -26,9 +26,4 @@
|
|||||||
android:entryValues="@array/wifi_calling_mode_values"
|
android:entryValues="@array/wifi_calling_mode_values"
|
||||||
android:dialogTitle="@string/wifi_calling_mode_dialog_title" />
|
android:dialogTitle="@string/wifi_calling_mode_dialog_title" />
|
||||||
|
|
||||||
<SwitchPreference
|
|
||||||
android:key="wifi_calling_roam"
|
|
||||||
android:title="@string/wifi_calling_roam_title"
|
|
||||||
android:persistent="false"/>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import android.content.IntentFilter;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.SwitchPreference;
|
|
||||||
import android.telephony.PhoneStateListener;
|
import android.telephony.PhoneStateListener;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -38,8 +37,7 @@ import com.android.settings.widget.SwitchBar;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* "Wi-Fi Calling settings" screen. This preference screen lets you
|
* "Wi-Fi Calling settings" screen. This preference screen lets you
|
||||||
* enable/disable Wi-Fi Calling, change mode, enable/disable
|
* enable/disable Wi-Fi Calling and change Wi-Fi Calling mode.
|
||||||
* handover while on roaming.
|
|
||||||
*/
|
*/
|
||||||
public class WifiCallingSettings extends SettingsPreferenceFragment
|
public class WifiCallingSettings extends SettingsPreferenceFragment
|
||||||
implements SwitchBar.OnSwitchChangeListener,
|
implements SwitchBar.OnSwitchChangeListener,
|
||||||
@@ -49,13 +47,11 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
//String keys for preference lookup
|
//String keys for preference lookup
|
||||||
private static final String BUTTON_WFC_MODE = "wifi_calling_mode";
|
private static final String BUTTON_WFC_MODE = "wifi_calling_mode";
|
||||||
private static final String BUTTON_WFC_ROAM = "wifi_calling_roam";
|
|
||||||
|
|
||||||
//UI objects
|
//UI objects
|
||||||
private SwitchBar mSwitchBar;
|
private SwitchBar mSwitchBar;
|
||||||
private Switch mSwitch;
|
private Switch mSwitch;
|
||||||
private ListPreference mButtonWfcMode;
|
private ListPreference mButtonWfcMode;
|
||||||
private SwitchPreference mButtonWfcRoam;
|
|
||||||
|
|
||||||
private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
|
private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
|
||||||
/*
|
/*
|
||||||
@@ -77,18 +73,9 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
&& isNonTtyOrTtyOnVolteEnabled);
|
&& isNonTtyOrTtyOnVolteEnabled);
|
||||||
|
|
||||||
Preference pref = getPreferenceScreen().findPreference(BUTTON_WFC_MODE);
|
Preference pref = getPreferenceScreen().findPreference(BUTTON_WFC_MODE);
|
||||||
int wfcMode = ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY;
|
|
||||||
if (pref != null) {
|
if (pref != null) {
|
||||||
pref.setEnabled(isWfcEnabled
|
pref.setEnabled(isWfcEnabled
|
||||||
&& (state == TelephonyManager.CALL_STATE_IDLE));
|
&& (state == TelephonyManager.CALL_STATE_IDLE));
|
||||||
ListPreference prefWfcMode = (ListPreference) pref;
|
|
||||||
wfcMode = Integer.valueOf(prefWfcMode.getValue()).intValue();
|
|
||||||
}
|
|
||||||
pref = getPreferenceScreen().findPreference(BUTTON_WFC_ROAM);
|
|
||||||
if (pref != null) {
|
|
||||||
pref.setEnabled(isWfcEnabled
|
|
||||||
&& (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY)
|
|
||||||
&& (state == TelephonyManager.CALL_STATE_IDLE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -154,9 +141,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
mButtonWfcMode = (ListPreference) findPreference(BUTTON_WFC_MODE);
|
mButtonWfcMode = (ListPreference) findPreference(BUTTON_WFC_MODE);
|
||||||
mButtonWfcMode.setOnPreferenceChangeListener(this);
|
mButtonWfcMode.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
mButtonWfcRoam = (SwitchPreference) findPreference(BUTTON_WFC_ROAM);
|
|
||||||
mButtonWfcRoam.setOnPreferenceChangeListener(this);
|
|
||||||
|
|
||||||
mIntentFilter = new IntentFilter();
|
mIntentFilter = new IntentFilter();
|
||||||
mIntentFilter.addAction(ImsPhone.REGISTRATION_ERROR);
|
mIntentFilter.addAction(ImsPhone.REGISTRATION_ERROR);
|
||||||
}
|
}
|
||||||
@@ -183,10 +167,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
mButtonWfcMode.setValue(Integer.toString(wfcMode));
|
mButtonWfcMode.setValue(Integer.toString(wfcMode));
|
||||||
mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode));
|
mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode));
|
||||||
|
|
||||||
mButtonWfcRoam.setChecked(wfcEnabled
|
|
||||||
&& (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY)
|
|
||||||
&& ImsManager.isWfcRoamingEnabledByUser(context));
|
|
||||||
|
|
||||||
context.registerReceiver(mIntentReceiver, mIntentFilter);
|
context.registerReceiver(mIntentReceiver, mIntentFilter);
|
||||||
|
|
||||||
Intent intent = getActivity().getIntent();
|
Intent intent = getActivity().getIntent();
|
||||||
@@ -223,10 +203,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
int wfcMode = ImsManager.getWfcMode(context);
|
int wfcMode = ImsManager.getWfcMode(context);
|
||||||
mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode));
|
mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode));
|
||||||
mButtonWfcMode.setEnabled(isChecked);
|
mButtonWfcMode.setEnabled(isChecked);
|
||||||
boolean wfcHandoffEnabled = (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY);
|
|
||||||
mButtonWfcRoam.setEnabled(isChecked && wfcHandoffEnabled);
|
|
||||||
mButtonWfcRoam.setChecked(isChecked && wfcHandoffEnabled
|
|
||||||
&& ImsManager.isWfcRoamingEnabledByUser(context));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -240,15 +216,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
ImsManager.setWfcMode(context, buttonMode);
|
ImsManager.setWfcMode(context, buttonMode);
|
||||||
mButtonWfcMode.setSummary(getWfcModeSummary(context, buttonMode));
|
mButtonWfcMode.setSummary(getWfcModeSummary(context, buttonMode));
|
||||||
}
|
}
|
||||||
boolean wfcHandoffEnabled =
|
|
||||||
(buttonMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY);
|
|
||||||
mButtonWfcRoam.setEnabled(wfcHandoffEnabled);
|
|
||||||
mButtonWfcRoam.setChecked(wfcHandoffEnabled &&
|
|
||||||
ImsManager.isWfcRoamingEnabledByUser(context));
|
|
||||||
} else if (preference == mButtonWfcRoam) {
|
|
||||||
SwitchPreference wfcRoamPref = (SwitchPreference) preference;
|
|
||||||
wfcRoamPref.setChecked(!wfcRoamPref.isChecked());
|
|
||||||
ImsManager.setWfcRoamingSetting(context, wfcRoamPref.isChecked());
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user