Merge "[Settings] "Data during calls" in DDS SUB is still in advanced option." am: 4e8786c09b am: c034169ccd

Change-Id: I928f1223c983a6ffcfae75cdf193779a7e688a60
This commit is contained in:
Bonian Chen
2020-04-08 05:21:31 +00:00
committed by Automerger Merge Worker
2 changed files with 45 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ package com.android.settings.network;
import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
import static com.google.common.truth.Truth.assertThat;
@@ -131,4 +132,24 @@ public class DataDuringCallsPreferenceControllerTest {
assertThat(mController.isAvailable()).isTrue();
assertThat(mSwitchPreference.isVisible()).isTrue();
}
@Test
public void getAvailabilityStatus_mobileDataChangWithDefaultDataSubId_returnUnavailable() {
ShadowSubscriptionManager.setDefaultDataSubscriptionId(SUB_ID_1);
mController.refreshPreference();
assertThat(mController.getAvailabilityStatus(SUB_ID_1))
.isEqualTo(CONDITIONALLY_UNAVAILABLE);
}
@Test
public void getAvailabilityStatus_mobileDataChangWithoutDefaultDataSubId_returnAvailable() {
ShadowSubscriptionManager.setDefaultDataSubscriptionId(SUB_ID_1);
mController.displayPreference(mPreferenceScreen);
mController.refreshPreference();
assertThat(mController.getAvailabilityStatus(SUB_ID_2)).isEqualTo(AVAILABLE);
}
}