Skip to content

Commit

Permalink
Reset Android icd storage before init
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed Feb 4, 2025
1 parent 951830b commit 64bbc62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controller/java/AndroidDeviceControllerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ AndroidDeviceControllerWrapper * AndroidDeviceControllerWrapper::AllocateNew(
chip::Credentials::SetDeviceAttestationVerifier(GetDefaultDACVerifier(testingRootStore));
}

// Because garbage collection may delay the removal of old controller instances, two instances could temporarily exist.
// To avoid issues with the shared ICD client storage, reset the storage before creating a new controller.
getICDClientStorage()->Shutdown();
*errInfoOnFailure = getICDClientStorage()->Init(wrapperStorage, &wrapper->mSessionKeystore);
if (*errInfoOnFailure != CHIP_NO_ERROR)
{
Expand Down

0 comments on commit 64bbc62

Please sign in to comment.