Fix the "Video call" can be searched on unsupported device.
The non-indexable does not work due to the NPE. Fixes: 186594185 Test: robo test and see the search result. Change-Id: Idc733b3521a774fa8b61a853aa078f50afc331cb
This commit is contained in:
@@ -71,6 +71,10 @@ public class Enable2gPreferenceController extends TelephonyTogglePreferenceContr
|
|||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus(int subId) {
|
public int getAvailabilityStatus(int subId) {
|
||||||
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
|
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
|
||||||
|
if (mTelephonyManager == null) {
|
||||||
|
Log.w(LOG_TAG, "Telephony manager not yet initialized");
|
||||||
|
mTelephonyManager = mContext.getSystemService(TelephonyManager.class);
|
||||||
|
}
|
||||||
boolean visible =
|
boolean visible =
|
||||||
SubscriptionManager.isUsableSubscriptionId(subId)
|
SubscriptionManager.isUsableSubscriptionId(subId)
|
||||||
&& carrierConfig != null
|
&& carrierConfig != null
|
||||||
|
@@ -63,6 +63,7 @@ public class EnabledNetworkModePreferenceController extends
|
|||||||
public EnabledNetworkModePreferenceController(Context context, String key) {
|
public EnabledNetworkModePreferenceController(Context context, String key) {
|
||||||
super(context, key);
|
super(context, key);
|
||||||
mSubscriptionsListener = new SubscriptionsChangeListener(context, this);
|
mSubscriptionsListener = new SubscriptionsChangeListener(context, this);
|
||||||
|
mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -145,7 +146,6 @@ public class EnabledNetworkModePreferenceController extends
|
|||||||
mSubId = subId;
|
mSubId = subId;
|
||||||
mTelephonyManager = mContext.getSystemService(TelephonyManager.class)
|
mTelephonyManager = mContext.getSystemService(TelephonyManager.class)
|
||||||
.createForSubscriptionId(mSubId);
|
.createForSubscriptionId(mSubId);
|
||||||
mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
|
|
||||||
mBuilder = new PreferenceEntriesBuilder(mContext, mSubId);
|
mBuilder = new PreferenceEntriesBuilder(mContext, mSubId);
|
||||||
|
|
||||||
if (mAllowedNetworkTypesListener == null) {
|
if (mAllowedNetworkTypesListener == null) {
|
||||||
|
Reference in New Issue
Block a user