am 948b99ed: (-s ours) am 929e0a19: Add better documentation to fingerprint.h
* commit '948b99ed9d7fdc45e9512d51667fb2b3c161608b':
diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h
index da7f4b8..3427213 100644
--- a/include/hardware/bluetooth.h
+++ b/include/hardware/bluetooth.h
@@ -542,6 +542,12 @@
* Function is synchronous and |fd| is owned by caller.
*/
void (*dump)(int fd);
+
+ /**
+ * Clear /data/misc/bt_config.conf and erase all stored connections
+ */
+ int (*config_clear)(void);
+
} bt_interface_t;
/** TODO: Need to add APIs for Service Discovery, Service authorization and
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index 486e27a..eadcdaa 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -33,7 +33,7 @@
#include <cutils/log.h>
#include <cutils/atomic.h>
-#if HAVE_ANDROID_OS
+#ifdef __ANDROID__
#include <linux/fb.h>
#endif
diff --git a/modules/sensors/Android.mk b/modules/sensors/Android.mk
index 445f69e..94d100b 100644
--- a/modules/sensors/Android.mk
+++ b/modules/sensors/Android.mk
@@ -20,9 +20,9 @@
include $(CLEAR_VARS)
-LOCAL_MODULE := sensors.$(TARGET_DEVICE)
+LOCAL_MODULE := sensors.$(TARGET_BOARD_PLATFORM)
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_CFLAGS := -DLOG_TAG=\"MultiHal\"
diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp
index cd67f6d..8330ff3 100644
--- a/modules/sensors/multihal.cpp
+++ b/modules/sensors/multihal.cpp
@@ -27,6 +27,8 @@
#include <cutils/log.h>
#include <vector>
+#include <string>
+#include <fstream>
#include <map>
#include <string>
@@ -34,10 +36,10 @@
#include <dlfcn.h>
#include <SensorEventQueue.h>
+#include <limits.h>
+#include <stdlib.h>
static const char* CONFIG_FILENAME = "/system/etc/sensors/hals.conf";
-static const char* LEGAL_SUBHAL_PATH_PREFIX = "/system/lib/hw/";
-static const char* LEGAL_SUBHAL_ALTERNATE_PATH_PREFIX = "/system/vendor/lib/";
static const int MAX_CONF_LINE_LENGTH = 1024;
static pthread_mutex_t init_modules_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -463,39 +465,19 @@
* Adds valid paths from the config file to the vector passed in.
* The vector must not be null.
*/
-static void get_so_paths(std::vector<char*> *so_paths) {
- FILE *conf_file = fopen(CONFIG_FILENAME, "r");
- if (conf_file == NULL) {
+static void get_so_paths(std::vector<std::string> *so_paths) {
+ std::string line;
+ std::ifstream conf_file(CONFIG_FILENAME);
+
+ if(!conf_file) {
ALOGW("No multihal config file found at %s", CONFIG_FILENAME);
return;
}
ALOGV("Multihal config file found at %s", CONFIG_FILENAME);
- char *line = NULL;
- size_t len = 0;
- int line_count = 0;
- while (getline(&line, &len, conf_file) != -1) {
- // overwrite trailing eoln with null char
- char* pch = strchr(line, '\n');
- if (pch != NULL) {
- *pch = '\0';
- }
- ALOGV("config file line #%d: '%s'", ++line_count, line);
- char *real_path = realpath(line, NULL);
- if (starts_with(real_path, LEGAL_SUBHAL_PATH_PREFIX) ||
- starts_with(real_path, LEGAL_SUBHAL_ALTERNATE_PATH_PREFIX)) {
- ALOGV("accepting valid path '%s'", real_path);
- char* compact_line = new char[strlen(real_path) + 1];
- strcpy(compact_line, real_path);
- so_paths->push_back(compact_line);
- } else {
- ALOGW("rejecting path '%s' because it does not start with '%s' or '%s'",
- real_path, LEGAL_SUBHAL_PATH_PREFIX, LEGAL_SUBHAL_ALTERNATE_PATH_PREFIX);
- }
- free(real_path);
+ while (std::getline(conf_file, line)) {
+ ALOGV("config file line: '%s'", line.c_str());
+ so_paths->push_back(line);
}
- free(line);
- fclose(conf_file);
- ALOGV("hals.conf contained %d lines", line_count);
}
/*
@@ -508,15 +490,15 @@
pthread_mutex_unlock(&init_modules_mutex);
return;
}
- std::vector<char*> *so_paths = new std::vector<char*>();
+ std::vector<std::string> *so_paths = new std::vector<std::string>();
get_so_paths(so_paths);
// dlopen the module files and cache their module symbols in sub_hw_modules
sub_hw_modules = new std::vector<hw_module_t *>();
dlerror(); // clear any old errors
const char* sym = HAL_MODULE_INFO_SYM_AS_STR;
- for (std::vector<char*>::iterator it = so_paths->begin(); it != so_paths->end(); it++) {
- char* path = *it;
+ for (std::vector<std::string>::iterator it = so_paths->begin(); it != so_paths->end(); it++) {
+ const char* path = it->c_str();
void* lib_handle = dlopen(path, RTLD_LAZY);
if (lib_handle == NULL) {
ALOGW("dlerror(): %s", dlerror());
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c
index bbea5f5..38fea86 100644
--- a/modules/usbaudio/audio_hal.c
+++ b/modules/usbaudio/audio_hal.c
@@ -442,8 +442,16 @@
static int out_get_presentation_position(const struct audio_stream_out *stream,
uint64_t *frames, struct timespec *timestamp)
{
- /* FIXME - This needs to be implemented */
- return -EINVAL;
+ struct stream_out *out = (struct stream_out *)stream; // discard const qualifier
+ lock_output_stream(out);
+
+ const alsa_device_proxy *proxy = &out->proxy;
+ const int ret = proxy_get_presentation_position(proxy, frames, timestamp);
+
+ pthread_mutex_unlock(&out->lock);
+ ALOGV("out_get_presentation_position() status:%d frames:%llu",
+ ret, (unsigned long long)*frames);
+ return ret;
}
static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)