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

Commit e06e1519 authored by Marie Janssen's avatar Marie Janssen
Browse files

build: LOG_TAG consistency, include order, build fixes

Fix the order of includes across a bunch of files, and declare LOG_TAG
at the top of every file in which it is used.

Consistently use bt_ as a LOG_TAG prefix.
Fix issues with LOG macro usage.
Remove unused includes and double-includes (when in related .h)

Add includes as necessary to compile cleanly (problems surfaced by
reordering includes)

Change-Id: Ic55520c8302b06bbc1942c10c448b20844669da6
parent af8b6185
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
 *
 ******************************************************************************/

#define LOG_TAG "bt_bta_av"

#include "bt_target.h"

#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
@@ -41,7 +43,6 @@
#include "bta_ar_api.h"
#endif

#define LOG_TAG "bt_bta_av"
#include "osi/include/log.h"

/*****************************************************************************
@@ -142,7 +143,6 @@ void bta_av_del_rc(tBTA_AV_RCB *p_rcb)
    }
}


/*******************************************************************************
**
** Function         bta_av_close_all_rc
@@ -334,7 +334,6 @@ UINT8 bta_av_rc_create(tBTA_AV_CB *p_cb, UINT8 role, UINT8 shdl, UINT8 lidx)
    /* note: BTA_AV_FEAT_RCTG = AVRC_CT_TARGET, BTA_AV_FEAT_RCCT = AVRC_CT_CONTROL */
    ccb.control = p_cb->features & (BTA_AV_FEAT_RCTG | BTA_AV_FEAT_RCCT | AVRC_CT_PASSIVE);


    if (AVRC_Open(&rc_handle, &ccb, bda) != AVRC_SUCCESS)
        return BTA_AV_RC_HANDLE_NONE;

@@ -522,7 +521,6 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
        return;
    }


    if (p_cb->rcb[i].lidx == (BTA_AV_NUM_LINKS + 1) && shdl != 0)
    {
        /* rc is opened on the RC only ACP channel, but is for a specific
@@ -581,7 +579,6 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)

}


/*******************************************************************************
**
** Function         bta_av_rc_remote_cmd
@@ -718,8 +715,6 @@ void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
    UNUSED(p_data);
}



/*******************************************************************************
**
** Function         bta_av_chk_notif_evt_id
@@ -839,7 +834,6 @@ tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE *p_rc_rsp, tBTA_AV_RC_MSG *p_ms
            }
            break;


        case AVRC_PDU_REGISTER_NOTIFICATION:
            /* make sure the event_id is implemented */
            p_rc_rsp->rsp.status = bta_av_chk_notif_evt_id (p_vendor);
@@ -859,7 +853,6 @@ tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE *p_rc_rsp, tBTA_AV_RC_MSG *p_ms
    return evt;
}


/*******************************************************************************
**
** Function         bta_av_rc_msg
@@ -1155,7 +1148,6 @@ void bta_av_stream_chg(tBTA_AV_SCB *p_scb, BOOLEAN started)
    }
}


/*******************************************************************************
**
** Function         bta_av_conn_chg
@@ -1226,7 +1218,6 @@ void bta_av_conn_chg(tBTA_AV_DATA *p_data)
                bta_av_cb.audio_open_cnt++;
            }


            APPL_TRACE_DEBUG("rc_acp_handle:%d rc_acp_idx:%d", p_cb->rc_acp_handle, p_cb->rc_acp_idx);
            /* check if the AVRCP ACP channel is already connected */
            if(p_lcb && p_cb->rc_acp_handle != BTA_AV_RC_HANDLE_NONE && p_cb->rc_acp_idx)
@@ -1471,7 +1462,6 @@ void bta_av_sig_chg(tBTA_AV_DATA *p_data)
                        /* Possible collision : need to avoid outgoing processing while the timer is running */
                        p_cb->p_scb[xx]->coll_mask = BTA_AV_COLL_INC_TMR;


                        // TODO(armansito): Why is this variable called "xx" and
                        // why is it a signed integer? The callback reinterprets
                        // it as a UINT8 and then reassigns it as param that
+1 −5
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
 *
 ******************************************************************************/

#define LOG_TAG "bta_av"
#define LOG_TAG "bt_bta_av"

#include <assert.h>
#include <string.h>
@@ -48,7 +48,6 @@
/* AVDTP protocol timeout values */
#define BTIF_AVK_SERVICE_NAME "Advanced Audio Sink"


#ifndef BTA_AV_RET_TOUT
#define BTA_AV_RET_TOUT     4
#endif
@@ -171,7 +170,6 @@ static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8
                                 app_id, BD_ADDR peer_addr);
static void bta_av_sys_rs_cback (tBTA_SYS_CONN_STATUS status,UINT8 id, UINT8 app_id, BD_ADDR peer_addr);


/* action functions */
const tBTA_AV_NSM_ACT bta_av_nsm_act[] =
{
@@ -1266,7 +1264,6 @@ void bta_av_sm_execute(tBTA_AV_CB *p_cb, UINT16 event, tBTA_AV_DATA *p_data)
    }
}


/*******************************************************************************
**
** Function         bta_av_hdl_event
@@ -1317,7 +1314,6 @@ BOOLEAN bta_av_hdl_event(BT_HDR *p_msg)
    return TRUE;
}


/*****************************************************************************
**  Debug Functions
*****************************************************************************/
+0 −5
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
#include <string.h>

#include "bt_target.h"

#include "bta_gattc_int.h"
#include "bta_sys.h"
#include "btif/include/btif_debug_conn.h"
@@ -120,7 +119,6 @@ static void bta_gattc_enable(tBTA_GATTC_CB *p_cb)
    }
}


/*******************************************************************************
**
** Function         bta_gattc_disable
@@ -185,7 +183,6 @@ void bta_gattc_register(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_data)
    tBTA_GATTC_INT_START_IF  *p_buf;
    tBTA_GATT_STATUS         status = BTA_GATT_NO_RESOURCES;


    APPL_TRACE_DEBUG("bta_gattc_register state %d",p_cb->state);
    memset(&cb_data, 0, sizeof(cb_data));
    cb_data.reg_oper.status = BTA_GATT_NO_RESOURCES;
@@ -772,7 +769,6 @@ void bta_gattc_close_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
        cb_data.close.status    = BTA_GATT_ERROR;
        cb_data.close.reason    = BTA_GATT_CONN_NONE;


        (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CLOSE_EVT, &cb_data);
    }
}
@@ -1451,7 +1447,6 @@ void bta_gattc_cfg_mtu_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data)

    utl_freebuf((void **)&p_clcb->p_q_cmd);


    if (p_data->p_cmpl  &&  p_data->status == BTA_GATT_OK)
        p_clcb->p_srcb->mtu  = p_data->p_cmpl->mtu;

+5 −5
Original line number Diff line number Diff line
@@ -29,16 +29,17 @@
#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)

#include <string.h>
#include "utl.h"
#include "gki.h"
#include "bta_sys.h"

#include "bta_gattc_int.h"
#include "bta_sys.h"
#include "gki.h"
#include "l2c_api.h"
#include "utl.h"

/*****************************************************************************
**  Constants
*****************************************************************************/


static const UINT8  base_uuid[LEN_UUID_128] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
    0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

@@ -856,7 +857,6 @@ tBTA_GATTC_CONN * bta_gattc_conn_find(BD_ADDR remote_bda)
    return NULL;
}


/*******************************************************************************
**
** Function         bta_gattc_conn_find_alloc
+5 −4
Original line number Diff line number Diff line
@@ -22,6 +22,10 @@
 *
 ******************************************************************************/

#define LOG_TAG "bt_bta_hh"

#include "bta_hh_api.h"

#include "bt_target.h"

#if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE)
@@ -30,13 +34,10 @@
#include <stdlib.h>
#include <string.h>

#include "bta_hh_api.h"
#include "bta_hh_int.h"
#include "l2c_api.h"
#include "utl.h"

#define LOG_TAG "bt_bta_hh"
#include "osi/include/log.h"
#include "utl.h"

/*****************************************************************************
**  Constants
Loading