Merge "[Settings] To avoid from crash when callback" into rvc-dev am: af05f6303d

Change-Id: Id17529753ddc58ba458c952f455dac8ef4e896ce
This commit is contained in:
Bonian Chen
2020-04-22 07:44:32 +00:00
committed by Automerger Merge Worker
3 changed files with 8 additions and 2 deletions

View File

@@ -133,6 +133,9 @@ public class Enhanced4gBasePreferenceController extends TelephonyTogglePreferenc
@Override
public void updateState(Preference preference) {
super.updateState(preference);
if (preference == null) {
return;
}
final SwitchPreference switchPreference = (SwitchPreference) preference;
final VolteQueryImsState queryState = queryImsState(mSubId);

View File

@@ -91,7 +91,8 @@ public class VideoCallingPreferenceController extends TelephonyTogglePreferenceC
@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;
}
final SwitchPreference switchPreference = (SwitchPreference) preference;

View File

@@ -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;