Skip to content

Commit

Permalink
fixed restyled-io
Browse files Browse the repository at this point in the history
  • Loading branch information
xylophone21 committed Sep 30, 2021
1 parent d3bf6f3 commit cde5ed2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class ChipDeviceController {
private CompletionListener completionListener;

/**
* To load class and jni,
* we need to new AndroidChipPlatform after jni load but before new ChipDeviceController
* To load class and jni, we need to new AndroidChipPlatform after jni load but before new
* ChipDeviceController
*/
public static void loadJni() {
return;
Expand Down Expand Up @@ -62,7 +62,11 @@ public void pairDevice(BluetoothGatt bleServer, int connId, long deviceId, long
* generated CSR nonce.
*/
public void pairDevice(
BluetoothGatt bleServer, int connId, long deviceId, long setupPincode, @Nullable byte[] csrNonce) {
BluetoothGatt bleServer,
int connId,
long deviceId,
long setupPincode,
@Nullable byte[] csrNonce) {
if (connectionId == 0) {
connectionId = connId;

Expand Down
3 changes: 2 additions & 1 deletion src/platform/android/AndroidChipPlatform-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
using namespace chip;

#define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_chip_platform_AndroidChipPlatform_##METHOD_NAME
#define JNI_MDNSCALLBACK_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_chip_platform_ChipMdnsCallbackImpl_##METHOD_NAME
#define JNI_MDNSCALLBACK_METHOD(RETURN, METHOD_NAME) \
extern "C" JNIEXPORT RETURN JNICALL Java_chip_platform_ChipMdnsCallbackImpl_##METHOD_NAME

static void ThrowError(JNIEnv * env, CHIP_ERROR errToThrow);
static CHIP_ERROR N2J_Error(JNIEnv * env, CHIP_ERROR inErr, jthrowable & outEx);
Expand Down
4 changes: 2 additions & 2 deletions src/platform/android/MdnsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ void InitializeWithObjects(jobject resolverObject, jobject mdnsCallbackObject)

VerifyOrReturn(resolverClass != nullptr, ChipLogError(Discovery, "Failed to get Resolver Java class"));

sResolveMethod = env->GetMethodID(resolverClass, "resolve",
"(Ljava/lang/String;Ljava/lang/String;JJLchip/platform/ChipMdnsCallback;)V");
sResolveMethod =
env->GetMethodID(resolverClass, "resolve", "(Ljava/lang/String;Ljava/lang/String;JJLchip/platform/ChipMdnsCallback;)V");

if (sResolveMethod == nullptr)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private synchronized int getConnId(BluetoothGatt gatt) {
while (connIndex < mConnections.size()) {
BluetoothGatt inGatt = mConnections.get(connIndex);
if (inGatt == gatt && gatt != null) {
return connIndex + 1;
return connIndex + 1;
}
connIndex++;
}
Expand Down Expand Up @@ -334,7 +334,7 @@ public boolean onCloseConnection(int connId) {
if (bluetoothGatt != null) {
bluetoothGatt.close();
removeConnection(connId);
if(mBleCallback != null) {
if (mBleCallback != null) {
mBleCallback.onCloseBleComplete(connId);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ private void setServiceResolver(ServiceResolver resolver, ChipMdnsCallback chipM
}
}

private native void nativeSetServiceResolver(ServiceResolver resolver, ChipMdnsCallback chipMdnsCallback);
private native void nativeSetServiceResolver(
ServiceResolver resolver, ChipMdnsCallback chipMdnsCallback);
}

0 comments on commit cde5ed2

Please sign in to comment.