Fix sim pin lock preference disappear in dual sim.

If one sim hide the preference and another one show the preference,
the preference always hide. The root cause is config value is wrong.
It should get config with subid.

Bug: 149800931
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SimLockPreferenceControllerTest
Change-Id: I91b551bc363b8ecb0a4b6b40e9de79c74ccd76fd
Merged-In: I91b551bc363b8ecb0a4b6b40e9de79c74ccd76fd
This commit is contained in:
SongFerngWang
2020-02-26 17:17:49 +08:00
parent e5f9bde2fd
commit 6c9ce4d892
3 changed files with 71 additions and 40 deletions

View File

@@ -103,7 +103,7 @@ public class SimLockPreferenceControllerTest {
setupMockIcc();
final PersistableBundle pb = new PersistableBundle();
pb.putBoolean(CarrierConfigManager.KEY_HIDE_SIM_LOCK_SETTINGS_BOOL, true);
when(mCarrierManager.getConfig()).thenReturn(pb);
when(mCarrierManager.getConfigForSubId(anyInt())).thenReturn(pb);
assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.DISABLED_FOR_USER);
@@ -114,7 +114,7 @@ public class SimLockPreferenceControllerTest {
when(mUserManager.isAdminUser()).thenReturn(true);
setupMockIcc();
final PersistableBundle pb = new PersistableBundle();
when(mCarrierManager.getConfig()).thenReturn(pb);
when(mCarrierManager.getConfigForSubId(anyInt())).thenReturn(pb);
assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.AVAILABLE);