Using ACTION_SIM_CARD_STATE_CHANGED to detect simSlotMapping is complete
Sometime modem can't return the GET_SIM_STATUS immediately, so that the settings send the sim switching too early after simSlotMapping. Bug: 291733084 Change-Id: If547c8b02020bc86c83915334e29945176a4ee9f Test: tester will test it manually.
This commit is contained in:
@@ -752,11 +752,14 @@ public class UiccSlotUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onReceiveSimSlotChangeReceiver_receiveAction_timerCountDown() {
|
||||
public void onReceiveSimCardStateChangeReceiver_receiveAction_timerCountDown() {
|
||||
CountDownLatch latch = spy(new CountDownLatch(1));
|
||||
UiccSlotUtil.SimSlotChangeReceiver receive = new UiccSlotUtil.SimSlotChangeReceiver(latch);
|
||||
UiccSlotUtil.SimCardStateChangeReceiver receive =
|
||||
new UiccSlotUtil.SimCardStateChangeReceiver(latch);
|
||||
Intent intent = new Intent(TelephonyManager.ACTION_SIM_SLOT_STATUS_CHANGED);
|
||||
intent.putExtra(TelephonyManager.EXTRA_SIM_STATE, TelephonyManager.SIM_STATE_PRESENT);
|
||||
|
||||
receive.onReceive(mContext, new Intent(TelephonyManager.ACTION_SIM_SLOT_STATUS_CHANGED));
|
||||
receive.onReceive(mContext, intent);
|
||||
|
||||
verify(latch).countDown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user