diff options
| author | 2023-03-28 19:33:57 +0000 | |
|---|---|---|
| committer | 2023-03-28 19:33:57 +0000 | |
| commit | 1dc4031b05c74cac9e147971a1e299dba8f1b346 (patch) | |
| tree | 8d5de3f1791e99e07f5ac92e83625647b407c1af | |
| parent | 998f25b08bca6a7d713c57f56021192e119aa798 (diff) | |
| parent | ac131bec4b8887cb6235a74414a967e1effdc53b (diff) | |
Merge "Revert "Ensure keyboard is hidden when bouncer is..."" into tm-qpr-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java | 10 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt | 20 |
2 files changed, 1 insertions, 29 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java index a010c9a16517..d221e22a4fcd 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java @@ -26,7 +26,6 @@ import android.text.method.TextKeyListener; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup.MarginLayoutParams; -import android.view.WindowInsets; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; @@ -157,15 +156,6 @@ public class KeyguardPasswordViewController // TODO: Remove this workaround by ensuring such a race condition never happens. mMainExecutor.executeDelayed( this::updateSwitchImeButton, DELAY_MILLIS_TO_REEVALUATE_IME_SWITCH_ICON); - mView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() { - @Override - public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { - if (!mKeyguardViewController.isBouncerShowing()) { - mView.hideKeyboard(); - } - return insets; - } - }); } @Override diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt index ed928702b981..d91279399341 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt @@ -18,10 +18,8 @@ package com.android.keyguard import android.testing.AndroidTestingRunner import android.testing.TestableLooper -import android.view.View import android.view.inputmethod.InputMethodManager import android.widget.EditText -import android.widget.ImageView import androidx.test.filters.SmallTest import com.android.internal.util.LatencyTracker import com.android.internal.widget.LockPatternUtils @@ -32,7 +30,6 @@ import com.android.systemui.util.concurrency.DelayableExecutor import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.mockito.ArgumentCaptor import org.mockito.ArgumentMatchers.anyBoolean import org.mockito.ArgumentMatchers.anyString import org.mockito.Mock @@ -40,7 +37,6 @@ import org.mockito.Mockito import org.mockito.Mockito.never import org.mockito.Mockito.verify import org.mockito.Mockito.`when` -import org.mockito.Mockito.mock import org.mockito.MockitoAnnotations @SmallTest @@ -80,9 +76,7 @@ class KeyguardPasswordViewControllerTest : SysuiTestCase() { Mockito.`when`(keyguardPasswordView.findViewById<EditText>(R.id.passwordEntry)) .thenReturn(passwordEntry) `when`(keyguardPasswordView.resources).thenReturn(context.resources) - `when`(keyguardPasswordView.findViewById<ImageView>(R.id.switch_ime_button)) - .thenReturn(mock(ImageView::class.java)) - keyguardPasswordViewController = + keyguardPasswordViewController = KeyguardPasswordViewController( keyguardPasswordView, keyguardUpdateMonitor, @@ -119,18 +113,6 @@ class KeyguardPasswordViewControllerTest : SysuiTestCase() { } @Test - fun onApplyWindowInsetsListener_onApplyWindowInsets() { - `when`(keyguardViewController.isBouncerShowing).thenReturn(false) - val argumentCaptor = ArgumentCaptor.forClass(View.OnApplyWindowInsetsListener::class.java) - - keyguardPasswordViewController.onViewAttached() - verify(keyguardPasswordView).setOnApplyWindowInsetsListener(argumentCaptor.capture()) - argumentCaptor.value.onApplyWindowInsets(keyguardPasswordView, null) - - verify(keyguardPasswordView).hideKeyboard() - } - - @Test fun testHideKeyboardWhenOnPause() { keyguardPasswordViewController.onPause() keyguardPasswordView.post { |