Merge "Handle null intent in WifiCallingPreferenceController" into qt-dev

This commit is contained in:
Lei Yu
2019-06-14 22:38:59 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.PersistableBundle;
import android.provider.Settings;
import android.telecom.PhoneAccountHandle;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -117,6 +118,14 @@ public class WifiCallingPreferenceControllerTest {
assertThat(mPreference.isEnabled()).isFalse();
}
@Test
public void updateState_invalidPhoneAccountHandle_shouldNotCrash() {
mController.mSimCallManager = new PhoneAccountHandle(null /* invalid */, "");
//Should not crash
mController.updateState(mPreference);
}
@Test
public void updateState_wfcNonRoaming() {
assertNull(mController.mSimCallManager);