diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 7c34725b446a22..c4100af0a0d9e5 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -637,6 +637,17 @@ JNI_METHOD(jboolean, openPairingWindowWithPIN) return true; } +JNI_METHOD(void, shutdownCommissioning) +(JNIEnv * env, jobject self, jlong handle) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + + AndroidDeviceControllerWrapper * wrapper = AndroidDeviceControllerWrapper::FromJNIHandle(handle); + err = wrapper->Controller()->Shutdown(); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Error invoking shutdownCommissioning: %s", ErrorStr(err))); +} + JNI_METHOD(jbyteArray, getAttestationChallenge) (JNIEnv * env, jobject self, jlong handle, jlong devicePtr) { diff --git a/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java b/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java index 9fa565e5a7cfbd..e31e18755d2712 100644 --- a/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java +++ b/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java @@ -369,6 +369,10 @@ public PaseVerifierParams computePaseVerifier( return computePaseVerifier(deviceControllerPtr, devicePtr, setupPincode, iterations, salt); } + public void shutdownCommissioning() { + shutdownCommissioning(deviceControllerPtr); + } + private native PaseVerifierParams computePaseVerifier( long deviceControllerPtr, long devicePtr, long setupPincode, long iterations, byte[] salt); @@ -452,6 +456,8 @@ private native boolean openPairingWindowWithPIN( private native void shutdownSubscriptions(long deviceControllerPtr, long devicePtr); + private native void shutdownCommissioning(long deviceControllerPtr); + static { System.loadLibrary("CHIPController"); }