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

Commit 7954940e authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Merge "Remove write type from GATT descriptor writes (2/4)"

am: 949bab8e

Change-Id: I08ecf740a524cb511d86aa771809ccbc4afbf57b
parents d792f149 949bab8e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1054,7 +1054,7 @@ static void gattClientExecuteWriteNative(JNIEnv* env, jobject object,
}

static void gattClientWriteDescriptorNative(JNIEnv* env, jobject object,
    jint conn_id, jint handle, jint write_type, jint auth_req, jbyteArray value)
    jint conn_id, jint handle, jint auth_req, jbyteArray value)
{
    if (!sGattIf) return;

@@ -1070,7 +1070,7 @@ static void gattClientWriteDescriptorNative(JNIEnv* env, jobject object,
    std::vector<uint8_t> vect_val(p_value, p_value + len);
    env->ReleaseByteArrayElements(value, p_value, 0);

    sGattIf->client->write_descriptor(conn_id, handle, write_type, auth_req,
    sGattIf->client->write_descriptor(conn_id, handle, auth_req,
                                      std::move(vect_val));
}

@@ -1684,7 +1684,7 @@ static JNINativeMethod sMethods[] = {
    {"gattClientReadCharacteristicNative", "(III)V", (void *) gattClientReadCharacteristicNative},
    {"gattClientReadDescriptorNative", "(III)V", (void *) gattClientReadDescriptorNative},
    {"gattClientWriteCharacteristicNative", "(IIII[B)V", (void *) gattClientWriteCharacteristicNative},
    {"gattClientWriteDescriptorNative", "(IIII[B)V", (void *) gattClientWriteDescriptorNative},
    {"gattClientWriteDescriptorNative", "(III[B)V", (void *) gattClientWriteDescriptorNative},
    {"gattClientExecuteWriteNative", "(IZ)V", (void *) gattClientExecuteWriteNative},
    {"gattClientRegisterForNotificationsNative", "(ILjava/lang/String;IZ)V", (void *) gattClientRegisterForNotificationsNative},
    {"gattClientReadRemoteRssiNative", "(ILjava/lang/String;)V", (void *) gattClientReadRemoteRssiNative},
+5 −5
Original line number Diff line number Diff line
@@ -382,10 +382,10 @@ public class GattService extends ProfileService {
        }

        public void writeDescriptor(int clientIf, String address, int handle,
                                    int writeType, int authReq, byte[] value) {
                                    int authReq, byte[] value) {
            GattService service = getService();
            if (service == null) return;
            service.writeDescriptor(clientIf, address, handle, writeType, authReq, value);
            service.writeDescriptor(clientIf, address, handle, authReq, value);
        }

        public void beginReliableWrite(int clientIf, String address) {
@@ -1444,7 +1444,7 @@ public class GattService extends ProfileService {
    };

    void writeDescriptor(int clientIf, String address, int handle,
                            int writeType, int authReq, byte[] value) {
                            int authReq, byte[] value) {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        if (VDBG) Log.d(TAG, "writeDescriptor() - address=" + address);

@@ -1459,7 +1459,7 @@ public class GattService extends ProfileService {
            return;
        }

        gattClientWriteDescriptorNative(connId, handle, writeType, authReq, value);
        gattClientWriteDescriptorNative(connId, handle, authReq, value);
    }

    void beginReliableWrite(int clientIf, String address) {
@@ -2149,7 +2149,7 @@ public class GattService extends ProfileService {
            int handle, int write_type, int auth_req, byte[] value);

    private native void gattClientWriteDescriptorNative(int conn_id, int handle,
            int write_type, int auth_req, byte[] value);
            int auth_req, byte[] value);

    private native void gattClientExecuteWriteNative(int conn_id, boolean execute);