OSDN Git Service

Linux build fix
authorBluetooth Build Test <test@build.com>
Thu, 7 Apr 2016 12:10:40 +0000 (14:10 +0200)
committerJakub Pawlowski <jpawlowski@google.com>
Tue, 12 Apr 2016 18:44:23 +0000 (18:44 +0000)
* add missing LOG_TAG definition
* add missing LOG_TAG inside LOG statements
* remove unnecessary includes of cutils/*.h files
* update libchrome/BUILD.gn to be on par with latest version of
  library used in Android

Bug: 28094186
Change-Id: I19a07afac20789b42a070995f6aa9da68b1bb940

btif/BUILD.gn
btif/src/btif_avrcp_audio_track.cpp
btif/src/btif_config.c
btif/src/btif_config_transcode.cpp
build/secondary/third_party/libchrome/BUILD.gn
device/src/classic/peer.c
hci/src/hci_layer.c
service/main.cpp

index f0d3ef8..8a459c8 100644 (file)
@@ -21,6 +21,7 @@ static_library("btif") {
     #TODO(jpawlowski): heavily depends on Android,
     #   "src/btif_avrcp_audio_track.cpp",
     "src/btif_config.c",
+    "src/btif_config_transcode.cpp",
     "src/btif_core.c",
     "src/btif_debug.c",
     "src/btif_debug_btsnoop.c",
index 73ad649..4d8e8dd 100644 (file)
@@ -15,6 +15,8 @@
  */
 
 //#define LOG_NDEBUG 0
+#define LOG_TAG "bt_btif_avrcp_audio_track"
+
 #include "btif_avrcp_audio_track.h"
 
 #include <media/AudioTrack.h>
index 64b5818..7eb5da3 100644 (file)
 #include "osi/include/config.h"
 #include "osi/include/log.h"
 #include "osi/include/osi.h"
-
-/**
- * TODO(apanicke): cutils/properties.h is only being used to pull-in runtime
- * settings on Android. Remove this conditional include once we have a generic
- * way to obtain system properties.
- */
-#if !defined(OS_GENERIC)
-#include <cutils/properties.h>
-#endif  /* !defined(OS_GENERIC) */
+#include "osi/include/properties.h"
 
 // TODO(armansito): Find a better way than searching by a hardcoded path.
 #if defined(OS_GENERIC)
@@ -131,23 +123,23 @@ static future_t *init(void) {
   config = config_new(CONFIG_FILE_PATH);
   btif_config_source = ORIGINAL;
   if (!config) {
-    LOG_WARN("%s unable to load config file: %s; using backup.",
+    LOG_WARN(LOG_TAG, "%s unable to load config file: %s; using backup.",
               __func__, CONFIG_FILE_PATH);
     config = config_new(CONFIG_BACKUP_PATH);
     btif_config_source = BACKUP;
   }
   if (!config) {
-    LOG_WARN("%s unable to load backup; attempting to transcode legacy file.", __func__);
+    LOG_WARN(LOG_TAG, "%s unable to load backup; attempting to transcode legacy file.", __func__);
     config = btif_config_transcode(CONFIG_LEGACY_FILE_PATH);
     btif_config_source = LEGACY;
   }
   if (!config) {
-    LOG_ERROR("%s unable to transcode legacy file; creating empty config.", __func__);
+    LOG_ERROR(LOG_TAG, "%s unable to transcode legacy file; creating empty config.", __func__);
     config = config_new_empty();
     btif_config_source = NEW_FILE;
   }
   if (!config) {
-    LOG_ERROR("%s unable to allocate a config object.", __func__);
+    LOG_ERROR(LOG_TAG, "%s unable to allocate a config object.", __func__);
     goto error;
   }
 
@@ -501,12 +493,12 @@ void btif_debug_config_dump(int fd) {
 
 static bool is_factory_reset(void) {
   char factory_reset[PROPERTY_VALUE_MAX] = {0};
-  property_get("persist.bluetooth.factoryreset", factory_reset, "false");
+  osi_property_get("persist.bluetooth.factoryreset", factory_reset, "false");
   return strncmp(factory_reset, "true", 4) == 0;
 }
 
 static void delete_config_files(void) {
   remove(CONFIG_FILE_PATH);
   remove(CONFIG_BACKUP_PATH);
-  property_set("persist.bluetooth.factoryreset", "false");
+  osi_property_set("persist.bluetooth.factoryreset", "false");
 }
index e9d859e..e8bd1a2 100644 (file)
@@ -31,19 +31,19 @@ extern "C" config_t *btif_config_transcode(const char *xml_filename) {
   XMLDocument document;
   int error = document.LoadFile(xml_filename);
   if (error != XML_SUCCESS) {
-    LOG_ERROR("%s unable to load XML file '%s': %d", __func__, xml_filename, error);
+    LOG_ERROR(LOG_TAG, "%s unable to load XML file '%s': %d", __func__, xml_filename, error);
     return NULL;
   }
 
   XMLElement *rootElement = document.RootElement();
   if (!rootElement) {
-    LOG_ERROR("%s unable to find root element; assuming corrupted config file.", __func__);
+    LOG_ERROR(LOG_TAG, "%s unable to find root element; assuming corrupted config file.", __func__);
     return NULL;
   }
 
   config_t *config = config_new_empty();
   if (!config) {
-    LOG_ERROR("%s unable to allocate config object.", __func__);
+    LOG_ERROR(LOG_TAG, "%s unable to allocate config object.", __func__);
     return NULL;
   }
 
index 167cb40..d95ced9 100644 (file)
@@ -83,6 +83,9 @@ source_set("base_sources") {
     "base/metrics/histogram.cc",
     "base/metrics/histogram_samples.cc",
     "base/metrics/histogram_snapshot_manager.cc",
+    "base/metrics/persistent_histogram_allocator.cc",
+    "base/metrics/persistent_memory_allocator.cc",
+    "base/metrics/persistent_sample_map.cc",
     "base/metrics/sample_map.cc",
     "base/metrics/sample_vector.cc",
     "base/metrics/sparse_histogram.cc",
@@ -105,7 +108,6 @@ source_set("base_sources") {
     "base/process/process_metrics_linux.cc",
     "base/process/process_metrics_posix.cc",
     "base/process/process_posix.cc",
-    "base/profiler/alternate_timer.cc",
     "base/profiler/scoped_profile.cc",
     "base/profiler/scoped_tracker.cc",
     "base/profiler/tracked_time.cc",
@@ -183,9 +185,7 @@ source_set("base_sources") {
     "base/trace_event/memory_dump_session_state.cc",
     "base/trace_event/process_memory_dump.cc",
     "base/trace_event/process_memory_maps.cc",
-    "base/trace_event/process_memory_maps_dump_provider.cc",
     "base/trace_event/process_memory_totals.cc",
-    "base/trace_event/process_memory_totals_dump_provider.cc",
     "base/trace_event/trace_buffer.cc",
     "base/trace_event/trace_config.cc",
     "base/trace_event/trace_event_argument.cc",
index 1bab300..a71918d 100644 (file)
@@ -21,7 +21,6 @@
 #include "device/include/classic/peer.h"
 
 #include <assert.h>
-#include <cutils/log.h>
 #include <pthread.h>
 #include <stdbool.h>
 
index b169b03..929987f 100644 (file)
@@ -175,10 +175,7 @@ static future_t *start_up(void) {
 
   pthread_mutex_init(&commands_pending_response_lock, NULL);
 
-  // TODO(armansito): cutils/properties.h is only being used to pull-in runtime
-  // settings on Android. Remove this conditional include once we have a generic
-  // way to obtain system properties. For now, always use the default timeout on
-  // non-Android builds.
+  // For now, always use the default timeout on non-Android builds.
   period_ms_t startup_timeout_ms = DEFAULT_STARTUP_TIMEOUT_MS;
 
   // Grab the override startup timeout ms, if present.
index 3ab81e6..fc5eec6 100644 (file)
 #include <base/files/scoped_file.h>
 #include <base/logging.h>
 
-// For system properties
-// TODO(icoolidge): abstraction or non-cutils stub.
-#if !defined(OS_GENERIC)
-#include <cutils/properties.h>
-#endif  // !defined(OS_GENERIC)
-
+#include "osi/include/properties.h"
 #include "service/daemon.h"
 #include "service/switches.h"