Rename references to getLteOnCdmaMode

Use @SystemApi TelephonyManager#isGlobalModeEnabled()

Test: build
Bug: 147335742
Change-Id: Ie1b01a97cf163d68e4a5529f1718a9a782d44bb0
This commit is contained in:
Sarah Chin
2020-01-14 17:16:21 -08:00
parent 66349e21c3
commit de616afce0
6 changed files with 12 additions and 36 deletions

View File

@@ -28,8 +28,6 @@ import android.text.TextUtils;
import androidx.preference.Preference;
import com.android.internal.telephony.PhoneConstants;
/**
* Preference controller for "Data service setup"
*/
@@ -49,14 +47,12 @@ public class DataServiceSetupPreferenceController extends TelephonyBasePreferenc
@Override
public int getAvailabilityStatus(int subId) {
final boolean isLteOnCdma = mTelephonyManager.getLteOnCdmaMode()
== PhoneConstants.LTE_ON_CDMA_TRUE;
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
&& carrierConfig != null
&& !carrierConfig.getBoolean(
CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)
&& isLteOnCdma && !TextUtils.isEmpty(mSetupUrl)
&& mTelephonyManager.isGlobalModeEnabled() && !TextUtils.isEmpty(mSetupUrl)
? AVAILABLE
: CONDITIONALLY_UNAVAILABLE;
}