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
This commit is contained in:
SongFerngWang
2020-02-26 17:17:49 +08:00
parent ad30345078
commit 3d54554521
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);