public byte[] decrypt(final byte[] iv, final byte[] ciphertext, final byte[] associatedData)
      throws GeneralSecurityException {
    if (iv.length != IV_SIZE_IN_BYTES) {
      throw new GeneralSecurityException("iv is wrong size");
    }
    if (ciphertext.length < TAG_SIZE_IN_BYTES) {
      throw new GeneralSecurityException("ciphertext too short");
    }

    AlgorithmParameterSpec params = getParams(iv);
    localCipher.get().init(Cipher.DECRYPT_MODE, keySpec, params);
    if (associatedData != null && associatedData.length != 0) {
      localCipher.get().updateAAD(associatedData);
    }
    return localCipher.get().doFinal(ciphertext);
  }
On Android KitKat (API level 19) this method does not support non null or non empty {@code
associatedData}. It might not work at all in older versions.
java_src/src/main/java/com/google/crypto/tink/aead/internal/InsecureNonceAesGcmJce.java