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

Commit 5828f667 authored by Aurimas Liutikas's avatar Aurimas Liutikas Committed by Andre Eisenbach
Browse files

Fix warnings in packages/apps/Bluetooth

Cherry-pick of https://android-review.googlesource.com/#/c/204513/

Bug: 27301103
Change-Id: I46e0094d8e58c4d3a3ed0401600e7176fb1417c6
parent 5a2e6b80
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_MULTILIB := 32

#LOCAL_CFLAGS += -O0 -g
LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-parameter

LOCAL_MODULE := libbluetooth_jni
LOCAL_MODULE_TAGS := optional
+0 −26
Original line number Diff line number Diff line
@@ -100,36 +100,11 @@ static btav_callbacks_t sBluetoothA2dpCallbacks = {
};

static void classInitNative(JNIEnv* env, jclass clazz) {
    int err;
    const bt_interface_t* btInf;
    bt_status_t status;

    method_onConnectionStateChanged =
        env->GetMethodID(clazz, "onConnectionStateChanged", "(I[B)V");

    method_onAudioStateChanged =
        env->GetMethodID(clazz, "onAudioStateChanged", "(I[B)V");
    /*
    if ( (btInf = getBluetoothInterface()) == NULL) {
        ALOGE("Bluetooth module is not loaded");
        return;
    }

    if ( (sBluetoothA2dpInterface = (btav_interface_t *)
          btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID)) == NULL) {
        ALOGE("Failed to get Bluetooth A2DP Interface");
        return;
    }
    */

    // TODO(BT) do this only once or
    //          Do we need to do this every time the BT reenables?
    /*
    if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks)) != BT_STATUS_SUCCESS) {
        ALOGE("Failed to initialize Bluetooth A2DP, status: %d", status);
        sBluetoothA2dpInterface = NULL;
        return;
    }*/

    ALOGI("%s: succeeds", __FUNCTION__);
}
@@ -172,7 +147,6 @@ static void initNative(JNIEnv *env, jobject object) {

static void cleanupNative(JNIEnv *env, jobject object) {
    const bt_interface_t* btInf;
    bt_status_t status;

    if ( (btInf = getBluetoothInterface()) == NULL) {
        ALOGE("Bluetooth module is not loaded");
+0 −5
Original line number Diff line number Diff line
@@ -148,10 +148,6 @@ static btav_callbacks_t sBluetoothA2dpCallbacks = {
};

static void classInitNative(JNIEnv* env, jclass clazz) {
    int err;
    const bt_interface_t* btInf;
    bt_status_t status;

    method_onConnectionStateChanged =
        env->GetMethodID(clazz, "onConnectionStateChanged", "(I[B)V");

@@ -205,7 +201,6 @@ static void initNative(JNIEnv *env, jobject object) {

static void cleanupNative(JNIEnv *env, jobject object) {
    const bt_interface_t* btInf;
    bt_status_t status;

    if ( (btInf = getBluetoothInterface()) == NULL) {
        ALOGE("Bluetooth module is not loaded");
+0 −3
Original line number Diff line number Diff line
@@ -294,7 +294,6 @@ static void device_found_callback(int num_properties, bt_property_t *properties)
static void bond_state_changed_callback(bt_status_t status, bt_bdaddr_t *bd_addr,
                                        bt_bond_state_t state) {
    jbyteArray addr;
    int i;
    if (!checkCallbackThread()) {
       ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__);
       return;
@@ -320,7 +319,6 @@ static void acl_state_changed_callback(bt_status_t status, bt_bdaddr_t *bd_addr,
                                       bt_acl_state_t state)
{
    jbyteArray addr;
    int i;
    if (!checkCallbackThread()) {
       ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__);
       return;
@@ -343,7 +341,6 @@ static void acl_state_changed_callback(bt_status_t status, bt_bdaddr_t *bd_addr,
}

static void discovery_state_changed_callback(bt_discovery_state_t state) {
    jbyteArray addr;
    if (!checkCallbackThread()) {
       ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__);
       return;
+0 −1
Original line number Diff line number Diff line
@@ -952,7 +952,6 @@ static void initializeNative(JNIEnv *env, jobject object) {
}

static void cleanupNative(JNIEnv *env, jobject object) {
    bt_status_t status;
    if (!btIf) return;

    if (sGattIf != NULL) {
Loading