[Settings] To avoid from crash when callback
Callback from SubscriptionManager and PhoneStateListner may comes in under the case of Preference not available. Bug: 141833767 Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=VideoCallingPreferenceControllerTest Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingPreferenceControllerTest Change-Id: I50b83b4488d272f6482bde5f09b57d59e6fc27a3
This commit is contained in:
@@ -30,6 +30,7 @@ import android.telephony.PhoneStateListener;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.telephony.ims.ImsMmTelManager;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
@@ -98,7 +99,8 @@ public class WifiCallingPreferenceController extends TelephonyBasePreferenceCont
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
if (mCallState == null) {
|
||||
if ((mCallState == null) || (preference == null)) {
|
||||
Log.d(TAG, "Skip update under mCallState=" + mCallState);
|
||||
return;
|
||||
}
|
||||
CharSequence summaryText = null;
|
||||
|
Reference in New Issue
Block a user