Skip to content

Commit 577b3f2

Browse files
Reset Android icd storage before init (project-chip#37396)
1 parent ecdf4eb commit 577b3f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/controller/java/AndroidDeviceControllerWrapper.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ AndroidDeviceControllerWrapper * AndroidDeviceControllerWrapper::AllocateNew(
159159
chip::Credentials::SetDeviceAttestationVerifier(GetDefaultDACVerifier(testingRootStore));
160160
}
161161

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

0 commit comments

Comments
 (0)