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

Commit 2ba29909 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "CryptoHal: graceful plugin creation failure" into sc-dev

parents c8dba222 cb57745c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -146,6 +146,9 @@ sp<ICryptoPlugin> CryptoHal::makeCryptoPlugin(const sp<ICryptoFactory>& factory,
                plugin = hPlugin;
            }
        );
    if (!hResult.isOk()) {
        mInitCheck = DEAD_OBJECT;
    }
    return plugin;
}

@@ -179,10 +182,8 @@ status_t CryptoHal::createPlugin(const uint8_t uuid[16], const void *data,
        }
    }

    if (mPlugin == NULL) {
        mInitCheck = ERROR_UNSUPPORTED;
    } else {
        mInitCheck = OK;
    if (mInitCheck == NO_INIT) {
        mInitCheck = mPlugin == NULL ? ERROR_UNSUPPORTED : OK;
    }

    return mInitCheck;