  @Test
  public void testSavedDecryptionWithScreenLock() {

    // Lock the screen.
    when(utils.isScreenLocked(context)).thenReturn(true);

    // No saved ciphertexts.
    decrypterManager.decryptSaved(handler, extra);
    verifyZeroInteractions(handler);

    // Save ciphertexts.
    int ciphertextCount = 10;
    ciphertextBuilder.setIsAuthKey(true);
    byte[] ciphertextBytes = ciphertextBuilder.build().toByteArray();
    saveCiphertexts(ciphertextBytes, ciphertextCount, ciphertextStorage);

    // Try to decrypt saved ciphertexts.
    decrypterManager.decryptSaved(handler, extra);
    verify(handler, times(ciphertextCount)).authCiphertextSavedForLater(ciphertextBytes, extra);
    verifyNoMoreInteractions(handler);
  }