Merge "Update summary for mobile data toggle for CBRS." into qt-dev am: cf964643b5
am: f8058733c2
Change-Id: Id779383a7216a53cc41c96eea76265c0a6b06105
This commit is contained in:
@@ -33,6 +33,8 @@ import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -165,5 +167,19 @@ public class MobileDataPreferenceControllerTest {
|
||||
mController.updateState(mPreference);
|
||||
|
||||
assertThat(mPreference.isEnabled()).isFalse();
|
||||
assertThat(mPreference.getSummary())
|
||||
.isEqualTo(mContext.getString(R.string.mobile_data_settings_summary_auto_switch));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateState_notOpportunistic_enabled() {
|
||||
doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(SUB_ID);
|
||||
mController.init(mFragmentManager, SUB_ID);
|
||||
doReturn(false).when(mSubscriptionInfo).isOpportunistic();
|
||||
mController.updateState(mPreference);
|
||||
|
||||
assertThat(mPreference.isEnabled()).isTrue();
|
||||
assertThat(mPreference.getSummary())
|
||||
.isEqualTo(mContext.getString(R.string.mobile_data_settings_summary));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user