Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27dd1a22 authored by Alex Klyubin's avatar Alex Klyubin
Browse files

Adjust the Javadoc for user authentication timeout.

The Javadoc incorrectly stated that:
* 0 means authentication required for every use.
* -1 means that timeout is not specified and the key can be any time.

Bug: 18088752
Change-Id: Ie5f37e74dc207f23443527ac1725ae8a37213d75
parent 6223ec12
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -195,10 +195,12 @@ public class KeyGeneratorSpec implements AlgorithmParameterSpec {

    /**
     * Gets the duration of time (seconds) for which this key can be used after the user is
     * successfully authenticated.
     * successfully authenticated. This has effect only if user authentication is required.
     *
     * @return duration in seconds or {@code -1} if authentication is required for every use of the
     *         key.
     *
     * @return duration in seconds or {@code -1} if not restricted. {@code 0} means authentication
     *         is required for every use of the key.
     * @see #isUserAuthenticationRequired()
     */
    public int getUserAuthenticationValidityDurationSeconds() {
        return mUserAuthenticationValidityDurationSeconds;
@@ -425,7 +427,7 @@ public class KeyGeneratorSpec implements AlgorithmParameterSpec {
         *
         * <p>By default, the user needs to authenticate for every use of the key.
         *
         * @param seconds duration in seconds or {@code 0} if the user needs to authenticate for
         * @param seconds duration in seconds or {@code -1} if the user needs to authenticate for
         *        every use of the key.
         *
         * @see #setUserAuthenticationRequired(boolean)
+5 −5
Original line number Diff line number Diff line
@@ -403,14 +403,14 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
    }

    /**
     * Gets the duration of time (seconds) for which the private key can be used after the user
     * is successfully authenticated.
     * Gets the duration of time (seconds) for which this key can be used after the user is
     * successfully authenticated. This has effect only if user authentication is required.
     *
     * <p>This restriction applies only to private key operations. Public key operations are not
     * restricted.
     *
     * @return duration in seconds or {@code -1} if not restricted. {@code 0} means authentication
     *         is required for every use of the key.
     * @return duration in seconds or {@code -1} if authentication is required for every use of the
     *         key.
     *
     * @see #isUserAuthenticationRequired()
     */
@@ -788,7 +788,7 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
         * <p>This restriction applies only to private key operations. Public key operations are not
         * restricted.
         *
         * @param seconds duration in seconds or {@code 0} if the user needs to authenticate for
         * @param seconds duration in seconds or {@code -1} if the user needs to authenticate for
         *        every use of the key.
         *
         * @see #setUserAuthenticationRequired(boolean)
+3 −3
Original line number Diff line number Diff line
@@ -179,10 +179,10 @@ public class KeyStoreKeySpec implements KeySpec {

    /**
     * Gets the duration of time (seconds) for which this key can be used after the user is
     * successfully authenticated.
     * successfully authenticated. This has effect only if user authentication is required.
     *
     * @return duration in seconds or {@code -1} if not restricted. {@code 0} means authentication
     *         is required for every use of the key.
     * @return duration in seconds or {@code -1} if authentication is required for every use of the
     *         key.
     *
     * @see #isUserAuthenticationRequired()
     */
+6 −4
Original line number Diff line number Diff line
@@ -218,10 +218,12 @@ public final class KeyStoreParameter implements ProtectionParameter {

    /**
     * Gets the duration of time (seconds) for which this key can be used after the user is
     * successfully authenticated.
     * successfully authenticated. This has effect only if user authentication is required.
     *
     * @return duration in seconds or {@code -1} if authentication is required for every use of the
     *         key.
     *
     * @return duration in seconds or {@code -1} if not restricted. {@code 0} means authentication
     *         is required for every use of the key.
     * @see #isUserAuthenticationRequired()
     */
    public int getUserAuthenticationValidityDurationSeconds() {
        return mUserAuthenticationValidityDurationSeconds;
@@ -462,7 +464,7 @@ public final class KeyStoreParameter implements ProtectionParameter {
         *
         * <p>By default, the user needs to authenticate for every use of the key.
         *
         * @param seconds duration in seconds or {@code 0} if the user needs to authenticate for
         * @param seconds duration in seconds or {@code -1} if the user needs to authenticate for
         *        every use of the key.
         *
         * @see #setUserAuthenticationRequired(boolean)