Merge "Add a condition for preventing NPE when accessing SatelliteManager" into main
This commit is contained in:
@@ -92,6 +92,14 @@ public class SatelliteSetting extends RestrictedDashboardFragment {
|
||||
}
|
||||
|
||||
mActivity = getActivity();
|
||||
|
||||
mSatelliteManager = mActivity.getSystemService(SatelliteManager.class);
|
||||
if (mSatelliteManager == null) {
|
||||
Log.d(TAG, "SatelliteManager is null, do nothing.");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
mSubId = mActivity.getIntent().getIntExtra(SUB_ID,
|
||||
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||
|
||||
@@ -104,7 +112,6 @@ public class SatelliteSetting extends RestrictedDashboardFragment {
|
||||
}
|
||||
|
||||
mTelephonymanager = mActivity.getSystemService(TelephonyManager.class);
|
||||
mSatelliteManager = mActivity.getSystemService(SatelliteManager.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,6 +64,10 @@ public class SatelliteSettingPreferenceController extends
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
if (mSatelliteManager == null) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(subId);
|
||||
final boolean isSatelliteAttachSupported = carrierConfig.getBoolean(
|
||||
CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL);
|
||||
|
||||
Reference in New Issue
Block a user