Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.hardware.face.FaceSensorProperties; import android.hardware.face.FaceSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintManager; import android.media.AudioManager; import android.nfc.NfcAdapter; import android.os.Bundle; import android.os.Handler; import android.os.IRemoteCallback; Loading Loading @@ -851,6 +852,17 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false); } @Test public void testRequireUnlockForNfc_Broadcast() { KeyguardUpdateMonitorCallback callback = mock(KeyguardUpdateMonitorCallback.class); mKeyguardUpdateMonitor.registerCallback(callback); Intent intent = new Intent(NfcAdapter.ACTION_REQUIRE_UNLOCK_FOR_NFC); mKeyguardUpdateMonitor.mBroadcastAllReceiver.onReceive(getContext(), intent); mTestableLooper.processAllMessages(); verify(callback, atLeastOnce()).onRequireUnlockForNfc(); } private void setKeyguardBouncerVisibility(boolean isVisible) { mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(isVisible); mTestableLooper.processAllMessages(); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -609,6 +609,16 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { assertThat(mTextView.getText()).isEqualTo(percentage); } @Test public void onRequireUnlockForNfc_showsRequireUnlockForNfcIndication() { createController(); String message = mContext.getString(R.string.require_unlock_for_nfc); mController.getKeyguardCallback().onRequireUnlockForNfc(); mController.setVisible(true); assertThat(mTextView.getText()).isEqualTo(message); } private void sendUpdateDisclosureBroadcast() { mBroadcastReceiver.onReceive(mContext, new Intent()); } Loading Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.hardware.face.FaceSensorProperties; import android.hardware.face.FaceSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintManager; import android.media.AudioManager; import android.nfc.NfcAdapter; import android.os.Bundle; import android.os.Handler; import android.os.IRemoteCallback; Loading Loading @@ -851,6 +852,17 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false); } @Test public void testRequireUnlockForNfc_Broadcast() { KeyguardUpdateMonitorCallback callback = mock(KeyguardUpdateMonitorCallback.class); mKeyguardUpdateMonitor.registerCallback(callback); Intent intent = new Intent(NfcAdapter.ACTION_REQUIRE_UNLOCK_FOR_NFC); mKeyguardUpdateMonitor.mBroadcastAllReceiver.onReceive(getContext(), intent); mTestableLooper.processAllMessages(); verify(callback, atLeastOnce()).onRequireUnlockForNfc(); } private void setKeyguardBouncerVisibility(boolean isVisible) { mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(isVisible); mTestableLooper.processAllMessages(); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -609,6 +609,16 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { assertThat(mTextView.getText()).isEqualTo(percentage); } @Test public void onRequireUnlockForNfc_showsRequireUnlockForNfcIndication() { createController(); String message = mContext.getString(R.string.require_unlock_for_nfc); mController.getKeyguardCallback().onRequireUnlockForNfc(); mController.setVisible(true); assertThat(mTextView.getText()).isEqualTo(message); } private void sendUpdateDisclosureBroadcast() { mBroadcastReceiver.onReceive(mContext, new Intent()); } Loading