diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index 8f0a65c33b2761..9d1484e9d32e2b 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -368,6 +368,12 @@ AndroidDeviceControllerWrapper * AndroidDeviceControllerWrapper::AllocateNew( return wrapper.release(); } +void AndroidDeviceControllerWrapper::Shutdown() +{ + mController->Shutdown(); + DeviceControllerFactory::GetInstance().Shutdown(); +} + CHIP_ERROR AndroidDeviceControllerWrapper::ApplyNetworkCredentials(chip::Controller::CommissioningParameters & params, jobject networkCredentials) { diff --git a/src/controller/java/AndroidDeviceControllerWrapper.h b/src/controller/java/AndroidDeviceControllerWrapper.h index 3f87e13a34e4a3..5e35214b620b67 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.h +++ b/src/controller/java/AndroidDeviceControllerWrapper.h @@ -173,6 +173,8 @@ class AndroidDeviceControllerWrapper : public chip::Controller::DevicePairingDel uint16_t failsafeTimerSeconds, bool attemptNetworkScanWiFi, bool attemptNetworkScanThread, bool skipCommissioningComplete, CHIP_ERROR * errInfoOnFailure); + void Shutdown(); + #ifdef JAVA_MATTER_CONTROLLER_TEST chip::Controller::ExampleOperationalCredentialsIssuer * GetAndroidOperationalCredentialsIssuer() #else diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index bca98e63ea177c..f2db96360a3f5a 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -1960,7 +1960,7 @@ JNI_METHOD(void, shutdownCommissioning) StopIOThread(); AndroidDeviceControllerWrapper * wrapper = AndroidDeviceControllerWrapper::FromJNIHandle(handle); - wrapper->Controller()->Shutdown(); + wrapper->Shutdown(); } JNI_METHOD(jbyteArray, getAttestationChallenge)