Skip to content

Commit

Permalink
Fix errors around logging when compiling on Linux
Browse files Browse the repository at this point in the history
* cutils/log.h -> log/log.h
* add missing #include "log/log.h"
* add android_errorWriteWithInfoLog stub

Test: compile on linux using ninja
Change-Id: I720921a2fbf86b5ce5e2a2f691f1e769c91672b6
  • Loading branch information
Jakub Pawlowski committed Oct 23, 2018
1 parent 292ab25 commit e4f1378
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions btif/src/btif_hf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <hardware/bluetooth_headset_callbacks.h>
#include <hardware/bluetooth_headset_interface.h>
#include <hardware/bt_hf.h>
#include <log/log.h>

#include "bta/include/utl.h"
#include "bta_ag_api.h"
Expand Down
9 changes: 8 additions & 1 deletion linux_include/log/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@
* limitations under the License.
*
******************************************************************************/
#pragma once

/* This file provides empty implementation of android_errorWriteLog, which is
* not required on linux. It should be on include path only for linux build. */

#if defined(OS_GENERIC)

inline int android_errorWriteLog(int, const char*) { return 0; };
#include <cstdint>

inline int android_errorWriteLog(int, const char*) { return 0; };
inline int android_errorWriteWithInfoLog(int tag, const char* subTag,
int32_t uid, const char* data,
uint32_t dataLen) {
return 0;
};
#endif
2 changes: 1 addition & 1 deletion osi/src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
******************************************************************************/

#include "osi/include/config.h"
#include "log/log.h"

#include <base/files/file_path.h>
#include <base/logging.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <log/log.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions stack/bnep/bnep_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
*
******************************************************************************/

#include <cutils/log.h>

#include <log/log.h>
#include <stdio.h>
#include <string.h>

#include "bnep_int.h"
#include "bt_common.h"
#include "bt_types.h"
Expand Down
3 changes: 2 additions & 1 deletion stack/gatt/gatt_sr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
*
******************************************************************************/

#include <log/log.h>
#include "bt_target.h"
#include "bt_utils.h"
#include "osi/include/osi.h"

#include <log/log.h>
#include <string.h>

#include "gatt_int.h"
#include "l2c_api.h"
#include "l2c_int.h"
Expand Down
2 changes: 1 addition & 1 deletion stack/sdp/sdp_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
******************************************************************************/

#include <cutils/log.h>
#include <log/log.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions stack/smp/smp_act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*
******************************************************************************/

#include <log/log.h>
#include <string.h>
#include "btif_common.h"
#include "btif_storage.h"
Expand Down
2 changes: 1 addition & 1 deletion stack/smp/smp_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "bt_target.h"

#include <cutils/log.h>
#include <log/log.h>
#include <string.h>
#include "smp_int.h"

Expand Down

0 comments on commit e4f1378

Please sign in to comment.