Only default APN type can make preference selectable.

- Current design is only to check mms type, but if there are other APN
 types group in one apn settings, it will show the radio button and the
 user can see the radio button and select it.

 - Improvement: Only make APN setting with defalut APN type be able to be selected.

Bug: 180475805
Test: Maunal test with ATT SIM.

Change-Id: Iae6943971c0cc6d31dc0e9d4dd97e850117adbfd
This commit is contained in:
tom hsu
2021-02-19 13:35:36 +08:00
committed by Tom Hsu
parent fcdd955dff
commit 9bd774a0b0

View File

@@ -43,6 +43,7 @@ import android.telephony.PreciseDataConnectionState;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.data.ApnSetting;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
@@ -344,7 +345,8 @@ public class ApnSettings extends RestrictedSettingsFragment
pref.setSummary(apn);
}
final boolean selectable = ((type == null) || !type.equals("mms"));
final boolean selectable =
((type == null) || type.contains(ApnSetting.TYPE_DEFAULT_STRING));
pref.setSelectable(selectable);
if (selectable) {
if ((mSelectedKey != null) && mSelectedKey.equals(key)) {