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

Commit 64209d7b authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by android-build-merger
Browse files

Merge "Revert "Throw invalid cert exception when deprecated...

Merge "Revert "Throw invalid cert exception when deprecated initRecoveryService method"" into pi-dev
am: 41d6d7c4

Change-Id: I38d4c4d99879961631b6596d1f37a65afe11a5b1
parents 2fb025d0 41d6d7c4
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -285,7 +285,17 @@ public class RecoveryController {
    public void initRecoveryService(
            @NonNull String rootCertificateAlias, @NonNull byte[] signedPublicKeyList)
            throws CertificateException, InternalRecoveryServiceException {
        throw new CertificateException("Deprecated initRecoveryService method called");
        try {
            mBinder.initRecoveryService(rootCertificateAlias, signedPublicKeyList);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        } catch (ServiceSpecificException e) {
            if (e.errorCode == ERROR_BAD_CERTIFICATE_FORMAT
                    || e.errorCode == ERROR_INVALID_CERTIFICATE) {
                throw new CertificateException("Invalid certificate for recovery service", e);
            }
            throw wrapUnexpectedServiceSpecificException(e);
        }
    }

    /**