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

Commit 2dfc3ae6 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Clean-up removed RecoveryController API

Bug: 79604447
Test: N/A
Change-Id: If12654aa46ba3a9d018eb68c4d0bec591a22bbb9
parent d72ccfff
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
@@ -91,38 +91,6 @@ package android.os {

}

package android.security.keystore.recovery {

  public final class KeyChainSnapshot implements android.os.Parcelable {
    method public deprecated byte[] getTrustedHardwarePublicKey();
  }

  public class RecoveryController {
    method public deprecated byte[] generateAndStoreKey(java.lang.String, byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method public deprecated java.security.Key generateKey(java.lang.String, byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method public deprecated java.util.List<java.lang.String> getAliases(java.lang.String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method public deprecated android.security.keystore.recovery.KeyChainSnapshot getRecoveryData() throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method public deprecated int getRecoveryStatus(java.lang.String, java.lang.String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method public deprecated void initRecoveryService(java.lang.String, byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
    method public deprecated void setRecoveryStatus(java.lang.String, java.lang.String, int) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.content.pm.PackageManager.NameNotFoundException;
  }

  public class RecoverySession implements java.lang.AutoCloseable {
    method public deprecated java.util.Map<java.lang.String, byte[]> recoverKeys(byte[], java.util.List<android.security.keystore.recovery.WrappedApplicationKey>) throws android.security.keystore.recovery.DecryptionFailedException, android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.SessionExpiredException;
    method public deprecated byte[] start(byte[], byte[], byte[], java.util.List<android.security.keystore.recovery.KeyChainProtectionParams>) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
    method public deprecated byte[] start(java.security.cert.CertPath, byte[], byte[], java.util.List<android.security.keystore.recovery.KeyChainProtectionParams>) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
  }

  public final class WrappedApplicationKey implements android.os.Parcelable {
    method public deprecated byte[] getAccount();
  }

  public static class WrappedApplicationKey.Builder {
    method public deprecated android.security.keystore.recovery.WrappedApplicationKey.Builder setAccount(byte[]);
  }

}

package android.service.notification {

  public abstract class NotificationListenerService extends android.app.Service {
+0 −25
Original line number Diff line number Diff line
@@ -112,19 +112,6 @@ public final class KeyChainSnapshot implements Parcelable {
        return mServerParams;
    }

    /**
     * Public key used to encrypt {@code encryptedRecoveryKeyBlob}.
     *
     * See implementation for binary key format.
     *
     * @deprecated Use {@link #getTrustedHardwareCertPath} instead.
     * @removed
     */
    @Deprecated
    public @NonNull byte[] getTrustedHardwarePublicKey() {
        throw new UnsupportedOperationException();
    }

    /**
     * CertPath containing the public key used to encrypt {@code encryptedRecoveryKeyBlob}.
     */
@@ -222,18 +209,6 @@ public final class KeyChainSnapshot implements Parcelable {
            return this;
        }

        /**
         * Sets public key used to encrypt recovery blob.
         *
         * @param publicKey The public key
         * @return This builder.
         * @removed Use {@link #setTrustedHardwareCertPath} instead.
         */
        @Deprecated
        public Builder setTrustedHardwarePublicKey(byte[] publicKey) {
            throw new UnsupportedOperationException();
        }

        /**
         * Sets CertPath used to validate the trusted hardware public key. The CertPath should
         * contain a certificate of the trusted hardware public key and any necessary intermediate
+0 −90
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.annotation.SystemApi;
import android.app.KeyguardManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
@@ -300,18 +299,6 @@ public class RecoveryController {
        return keyguardManager != null && keyguardManager.isDeviceSecure();
    }

    /**
     * @deprecated Use {@link #initRecoveryService(String, byte[], byte[])} instead.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public void initRecoveryService(
            @NonNull String rootCertificateAlias, @NonNull byte[] signedPublicKeyList)
            throws CertificateException, InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Initializes the recovery service for the calling application. The detailed steps should be:
     * <ol>
@@ -362,16 +349,6 @@ public class RecoveryController {
        }
    }

    /**
     * @deprecated Use {@link #getKeyChainSnapshot()}
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public @Nullable KeyChainSnapshot getRecoveryData() throws InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Returns data necessary to store all recoverable keys. Key material is
     * encrypted with user secret and recovery public key.
@@ -439,17 +416,6 @@ public class RecoveryController {
        }
    }

    /**
     * @deprecated Use {@link #getAliases()}.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public List<String> getAliases(@Nullable String packageName)
            throws InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Returns a list of aliases of keys belonging to the application.
     */
@@ -465,18 +431,6 @@ public class RecoveryController {
        }
    }

    /**
     * @deprecated Use {@link #setRecoveryStatus(String, int)}
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public void setRecoveryStatus(
            @NonNull String packageName, String alias, int status)
            throws NameNotFoundException, InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Sets the recovery status for given key. It is used to notify the keystore that the key was
     * successfully stored on the server or that there was an error. An application can check this
@@ -500,17 +454,6 @@ public class RecoveryController {
        }
    }

    /**
     * @deprecated Use {@link #getRecoveryStatus(String)}.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public int getRecoveryStatus(String packageName, String alias)
            throws InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Returns the recovery status for the key with the given {@code alias}.
     *
@@ -583,39 +526,6 @@ public class RecoveryController {
        }
    }

    /**
     * Deprecated.
     * Generates a AES256/GCM/NoPADDING key called {@code alias} and loads it into the recoverable
     * key store. Returns the raw material of the key.
     *
     * @param alias The key alias.
     * @param account The account associated with the key
     * @throws InternalRecoveryServiceException if an unexpected error occurred in the recovery
     *     service.
     * @throws LockScreenRequiredException if the user has not set a lock screen. This is required
     *     to generate recoverable keys, as the snapshots are encrypted using a key derived from the
     *     lock screen.
     * @deprecated Use {@link #generateKey(String)}
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public byte[] generateAndStoreKey(@NonNull String alias, byte[] account)
            throws InternalRecoveryServiceException, LockScreenRequiredException {
        throw new UnsupportedOperationException("Operation is not supported, use generateKey");
    }

    /**
     * @deprecated Use {@link #generateKey(String)}.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public Key generateKey(@NonNull String alias, byte[] account)
            throws InternalRecoveryServiceException, LockScreenRequiredException {
        throw new UnsupportedOperationException();
    }

    /**
     * Generates a recoverable key with the given {@code alias}.
     *
+0 −44
Original line number Diff line number Diff line
@@ -77,36 +77,6 @@ public class RecoverySession implements AutoCloseable {
        return sb.toString();
    }

    /**
     * @deprecated Use {@link #start(String, CertPath, byte[], byte[], List)} instead.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    @NonNull public byte[] start(
            @NonNull byte[] verifierPublicKey,
            @NonNull byte[] vaultParams,
            @NonNull byte[] vaultChallenge,
            @NonNull List<KeyChainProtectionParams> secrets)
            throws CertificateException, InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * @deprecated Use {@link #start(String, CertPath, byte[], byte[], List)} instead.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    @NonNull public byte[] start(
            @NonNull CertPath verifierCertPath,
            @NonNull byte[] vaultParams,
            @NonNull byte[] vaultChallenge,
            @NonNull List<KeyChainProtectionParams> secrets)
            throws CertificateException, InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Starts a recovery session and returns a blob with proof of recovery secret possession.
     * The method generates a symmetric key for a session, which trusted remote device can use to
@@ -161,20 +131,6 @@ public class RecoverySession implements AutoCloseable {
        }
    }

    /**
     * @deprecated Use {@link #recoverKeyChainSnapshot(byte[], List)} instead.
     * @removed
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE)
    public Map<String, byte[]> recoverKeys(
            @NonNull byte[] recoveryKeyBlob,
            @NonNull List<WrappedApplicationKey> applicationKeys)
            throws SessionExpiredException, DecryptionFailedException,
            InternalRecoveryServiceException {
        throw new UnsupportedOperationException();
    }

    /**
     * Imports key chain snapshot recovered from a remote vault.
     *
+0 −18
Original line number Diff line number Diff line
@@ -74,15 +74,6 @@ public final class WrappedApplicationKey implements Parcelable {
            return this;
        }

        /**
         * @deprecated AOSP does not associate keys with accounts. This may be done by system app.
         * @removed
         */
        @Deprecated
        public Builder setAccount(@NonNull byte[] account) {
            throw new UnsupportedOperationException();
        }

        /**
         * Sets key material encrypted by recovery key.
         *
@@ -133,15 +124,6 @@ public final class WrappedApplicationKey implements Parcelable {
        return mEncryptedKeyMaterial;
    }

    /**
     * @deprecated AOSP does not associate keys with accounts. This may be done by system app.
     * @removed
     */
    @Deprecated
    public @NonNull byte[] getAccount() {
        throw new UnsupportedOperationException();
    }

    public static final Parcelable.Creator<WrappedApplicationKey> CREATOR =
            new Parcelable.Creator<WrappedApplicationKey>() {
                public WrappedApplicationKey createFromParcel(Parcel in) {