Merge "Fix CombinationKeyTests failure" into udc-dev

This commit is contained in:
Arthur Hung
2023-04-27 14:35:59 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 4 deletions

View File

@@ -395,7 +395,7 @@ public final class SingleKeyGestureDetector {
private class KeyHandler extends Handler {
KeyHandler() {
super(Looper.getMainLooper());
super(Looper.myLooper());
}
@Override

View File

@@ -202,9 +202,11 @@ class TestPhoneWindowManager {
.canonicalToCurrentPackageNames(any());
} catch (PackageManager.NameNotFoundException ignored) { }
doReturn(mTelecomManager).when(mContext).getSystemService(eq(Context.TELECOM_SERVICE));
doReturn(mNotificationManager).when(mContext)
.getSystemService(eq(NotificationManager.class));
doReturn(false).when(mTelecomManager).isInCall();
doReturn(false).when(mTelecomManager).isRinging();
doReturn(mTelecomManager).when(mPhoneWindowManager).getTelecommService();
doNothing().when(mNotificationManager).silenceNotificationSound();
doReturn(mNotificationManager).when(mPhoneWindowManager).getNotificationService();
doReturn(mVibrator).when(mContext).getSystemService(eq(Context.VIBRATOR_SERVICE));
final PowerManager.WakeLock wakeLock = mock(PowerManager.WakeLock.class);
@@ -235,6 +237,7 @@ class TestPhoneWindowManager {
doNothing().when(mPhoneWindowManager).screenTurnedOn(anyInt());
doNothing().when(mPhoneWindowManager).startedWakingUp(anyInt(), anyInt());
doNothing().when(mPhoneWindowManager).finishedWakingUp(anyInt(), anyInt());
doNothing().when(mPhoneWindowManager).lockNow(any());
mPhoneWindowManager.init(new TestInjector(mContext, mWindowManagerFuncsImpl));
mPhoneWindowManager.systemReady();
@@ -249,6 +252,7 @@ class TestPhoneWindowManager {
void tearDown() {
mHandlerThread.quitSafely();
LocalServices.removeServiceForTest(InputMethodManagerInternal.class);
Mockito.reset(mPhoneWindowManager);
mMockitoSession.finishMocking();
}
@@ -322,6 +326,7 @@ class TestPhoneWindowManager {
void overrideDisplayState(int state) {
doReturn(state).when(mDisplay).getState();
doReturn(state == STATE_ON).when(mDisplayPolicy).isAwake();
Mockito.reset(mPowerManager);
}
@@ -388,6 +393,7 @@ class TestPhoneWindowManager {
}
void assertDreamRequest() {
waitForIdle();
verify(mDreamManagerInternal).requestDream();
}