Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ad05a22 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Automerger Merge Worker
Browse files

Merge "floss: JNI: Change vector to byte array in gatt client" am: 892c00b2 am: 6bb1aaf3

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1770186

Change-Id: Ie38f33d81edfe0b395947f1eefa8b2872a96aaf9
parents dd51747e 6bb1aaf3
Loading
Loading
Loading
Loading
+7 −8
Original line number Original line Diff line number Diff line
@@ -1313,11 +1313,11 @@ static void gattClientWriteCharacteristicNative(JNIEnv* env, jobject object,
  jbyte* p_value = env->GetByteArrayElements(value, NULL);
  jbyte* p_value = env->GetByteArrayElements(value, NULL);
  if (p_value == NULL) return;
  if (p_value == NULL) return;


  std::vector<uint8_t> vect_val(p_value, p_value + len);
  env->ReleaseByteArrayElements(value, p_value, 0);

  sGattIf->client->write_characteristic(conn_id, handle, write_type, auth_req,
  sGattIf->client->write_characteristic(conn_id, handle, write_type, auth_req,
                                        std::move(vect_val));
                                        reinterpret_cast<uint8_t*>(p_value),
                                        len);

  env->ReleaseByteArrayElements(value, p_value, 0);
}
}


static void gattClientExecuteWriteNative(JNIEnv* env, jobject object,
static void gattClientExecuteWriteNative(JNIEnv* env, jobject object,
@@ -1340,11 +1340,10 @@ static void gattClientWriteDescriptorNative(JNIEnv* env, jobject object,
  jbyte* p_value = env->GetByteArrayElements(value, NULL);
  jbyte* p_value = env->GetByteArrayElements(value, NULL);
  if (p_value == NULL) return;
  if (p_value == NULL) return;


  std::vector<uint8_t> vect_val(p_value, p_value + len);
  env->ReleaseByteArrayElements(value, p_value, 0);

  sGattIf->client->write_descriptor(conn_id, handle, auth_req,
  sGattIf->client->write_descriptor(conn_id, handle, auth_req,
                                    std::move(vect_val));
                                    reinterpret_cast<uint8_t*>(p_value), len);

  env->ReleaseByteArrayElements(value, p_value, 0);
}
}


static void gattClientRegisterForNotificationsNative(
static void gattClientRegisterForNotificationsNative(