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

Commit 337b9155 authored by Kyle Zhang's avatar Kyle Zhang
Browse files

Reset Init Check to NO_INIT after destroy in CryptoHal implementation

Bug: 230163440
Bug: 230716337
Bug: 228432745
Test: GtsMediaTestCases
Change-Id: I1c56408471f65effc9c075300cd49ee12f00dbec
parent 4408cbe0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ status_t CryptoHalAidl::destroyPlugin() {
    }

    mPlugin.reset();
    mInitCheck = NO_INIT;
    return OK;
}

@@ -372,6 +373,10 @@ int32_t CryptoHalAidl::setHeap(const sp<HidlMemory>& heap) {

    Mutex::Autolock autoLock(mLock);

    if (mInitCheck != OK) {
        return -1;
    }

    int32_t seqNum = mHeapSeqNum++;
    uint32_t bufferId = static_cast<uint32_t>(seqNum);
    mHeapSizes.add(seqNum, heap->size());
+5 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ status_t CryptoHalHidl::destroyPlugin() {

    mPlugin.clear();
    mPluginV1_2.clear();
    mInitCheck = NO_INIT;
    return OK;
}

@@ -221,6 +222,10 @@ int32_t CryptoHalHidl::setHeapBase(const sp<HidlMemory>& heap) {

    Mutex::Autolock autoLock(mLock);

    if (mInitCheck != OK) {
        return -1;
    }

    int32_t seqNum = mHeapSeqNum++;
    uint32_t bufferId = static_cast<uint32_t>(seqNum);
    mHeapSizes.add(seqNum, heap->size());