Merge "Fix NPE if CarrierConfigManager is not available"

This commit is contained in:
Treehugger Robot
2020-05-27 01:36:46 +00:00
committed by Gerrit Code Review

View File

@@ -98,7 +98,7 @@ public class ContactDiscoveryPreferenceController extends TelephonyTogglePrefere
@Override
public int getAvailabilityStatus(int subId) {
PersistableBundle bundle = mCarrierConfigManager.getConfigForSubId(subId);
boolean shouldShowPresence = bundle.getBoolean(
boolean shouldShowPresence = bundle != null && bundle.getBoolean(
CarrierConfigManager.KEY_USE_RCS_PRESENCE_BOOL, false /*default*/);
return shouldShowPresence ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
}