Merge "Removed reference to PhoneConstant PHONE_TYPE_*"

This commit is contained in:
TreeHugger Robot
2020-01-10 13:52:32 +00:00
committed by Android (Google) Code Review
6 changed files with 22 additions and 30 deletions

View File

@@ -31,7 +31,6 @@ import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
@@ -42,8 +41,8 @@ import androidx.preference.PreferenceScreen;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
import com.android.settings.R;
import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
import java.util.ArrayList;
import java.util.List;
@@ -176,7 +175,7 @@ public class EnabledNetworkModePreferenceController extends
private void updatePreferenceEntries(ListPreference preference) {
final int phoneType = mTelephonyManager.getPhoneType();
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if (phoneType == TelephonyManager.PHONE_TYPE_CDMA) {
final int lteForced = android.provider.Settings.Global.getInt(
mContext.getContentResolver(),
android.provider.Settings.Global.LTE_SERVICE_FORCED + mSubId,
@@ -221,7 +220,7 @@ public class EnabledNetworkModePreferenceController extends
}
}
}
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
} else if (phoneType == TelephonyManager.PHONE_TYPE_GSM) {
if (MobileNetworkUtils.isTdscdmaSupported(mContext, mSubId)) {
preference.setEntries(
R.array.enabled_networks_tdscdma_choices);
@@ -529,7 +528,7 @@ public class EnabledNetworkModePreferenceController extends
preference.setValue(
Integer.toString(TelephonyManagerConstants
.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
if (mTelephonyManager.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA
if (mTelephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA
|| mIsGlobalCdma
|| MobileNetworkUtils.isWorldMode(mContext, mSubId)) {
preference.setSummary(R.string.network_global);
@@ -553,7 +552,7 @@ public class EnabledNetworkModePreferenceController extends
case TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA:
preference.setValue(
Integer.toString(TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA));
if (mTelephonyManager.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA
if (mTelephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA
|| mIsGlobalCdma
|| MobileNetworkUtils.isWorldMode(mContext, mSubId)) {
preference.setSummary(R.string.network_global);

View File

@@ -51,7 +51,6 @@ import androidx.annotation.VisibleForTesting;
import com.android.ims.ImsException;
import com.android.ims.ImsManager;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -299,7 +298,7 @@ public class MobileNetworkUtils {
CarrierConfigManager.class).getConfigForSubId(subId);
if (telephonyManager.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
return true;
} else if (carrierConfig != null
&& !carrierConfig.getBoolean(
@@ -358,7 +357,7 @@ public class MobileNetworkUtils {
final PersistableBundle carrierConfig = context.getSystemService(
CarrierConfigManager.class).getConfigForSubId(subId);
if (telephonyManager.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM) {
if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
return true;
} else if (carrierConfig != null
&& !carrierConfig.getBoolean(

View File

@@ -156,7 +156,7 @@ public class PreferredNetworkModePreferenceController extends TelephonyBasePrefe
case TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
return R.string.preferred_network_mode_lte_tdscdma_cdma_evdo_gsm_wcdma_summary;
case TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
if (mTelephonyManager.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA
if (mTelephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA
|| mIsGlobalCdma
|| MobileNetworkUtils.isWorldMode(mContext, mSubId)) {
return R.string.preferred_network_mode_global_summary;