summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--audio/AudioPolicyManagerBase.cpp18
-rw-r--r--include/hardware_legacy/AudioPolicyManagerBase.h1
-rw-r--r--include/hardware_legacy/wifi_hal.h14
-rw-r--r--include/hardware_legacy/wifi_logger.h1
-rw-r--r--uevent/uevent.c1
-rw-r--r--wifi/wifi.c15
6 files changed, 30 insertions, 20 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index 74070fd..85b0084 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -2854,7 +2854,22 @@ uint32_t AudioPolicyManagerBase::setOutputDevice(audio_io_handle_t output,
if (device != AUDIO_DEVICE_NONE) {
outputDesc->mDevice = device;
+
+ // Force routing if previously asked for this output
+ if (outputDesc->mForceRouting) {
+ ALOGV("Force routing to current device as previous device was null for this output");
+ force = true;
+
+ // Request consumed. Reset mForceRouting to false
+ outputDesc->mForceRouting = false;
+ }
}
+ else {
+ // Device is null and does not reflect the routing. Save the necessity to force
+ // re-routing upon next attempt to select a non-null device for this output
+ outputDesc->mForceRouting = true;
+ }
+
muteWaitMs = checkDeviceMuteStrategies(outputDesc, prevDevice, delayMs);
// Do not change the routing if:
@@ -3475,7 +3490,8 @@ AudioPolicyManagerBase::AudioOutputDescriptor::AudioOutputDescriptor(
: mId(0), mSamplingRate(0), mFormat(AUDIO_FORMAT_DEFAULT),
mChannelMask(0), mLatency(0),
mFlags((audio_output_flags_t)0), mDevice(AUDIO_DEVICE_NONE),
- mOutput1(0), mOutput2(0), mProfile(profile), mDirectOpenCount(0)
+ mOutput1(0), mOutput2(0), mProfile(profile), mDirectOpenCount(0),
+ mForceRouting(false)
{
// clear usage count for all stream types
for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h
index 531a737..cf03f78 100644
--- a/include/hardware_legacy/AudioPolicyManagerBase.h
+++ b/include/hardware_legacy/AudioPolicyManagerBase.h
@@ -287,6 +287,7 @@ protected:
bool mStrategyMutedByDevice[NUM_STRATEGIES]; // strategies muted because of incompatible
// device selection. See checkDeviceMuteStrategies()
uint32_t mDirectOpenCount; // number of clients using this output (direct outputs only)
+ bool mForceRouting; // Next routing for this output will be forced as current device routed is null
};
// descriptor for audio inputs. Used to maintain current configuration of each opened audio input
diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h
index fa0aff0..2a99a43 100644
--- a/include/hardware_legacy/wifi_hal.h
+++ b/include/hardware_legacy/wifi_hal.h
@@ -17,6 +17,10 @@
#ifndef __WIFI_HAL_H__
#define __WIFI_HAL_H__
+#ifdef __cplusplus
+extern "C"
+{
+#endif
#include <stdint.h>
/* WiFi Common definitions */
@@ -72,10 +76,8 @@ typedef byte oui[3];
typedef int64_t wifi_timestamp; // In microseconds (us)
typedef int64_t wifi_timespan; // In nanoseconds (ns)
-struct wifi_info;
-typedef wifi_info *wifi_handle;
-struct wifi_interface_info;
-typedef wifi_interface_info *wifi_interface_handle;
+typedef struct wifi_info *wifi_handle;
+typedef struct wifi_interface_info *wifi_interface_handle;
/* Initialize/Cleanup */
@@ -156,7 +158,6 @@ wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs);
#include "wifi_logger.h"
#include "wifi_config.h"
#include "wifi_nan.h"
-
//wifi HAL function pointer table
typedef struct {
wifi_error (* wifi_initialize) (wifi_handle *);
@@ -203,6 +204,9 @@ typedef struct {
wifi_error (* wifi_set_country_code)(wifi_interface_handle, const char *);
} wifi_hal_fn;
wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h
index e34dee7..f125a20 100644
--- a/include/hardware_legacy/wifi_logger.h
+++ b/include/hardware_legacy/wifi_logger.h
@@ -290,7 +290,6 @@ wifi_error wifi_get_firmware_version(wifi_request_id id,
wifi_error wifi_get_driver_version(wifi_request_id id,
wifi_interface_handle iface, char **buffer, int *buffer_size);
-
/* Feature set */
enum {
WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)), // Memory dump of FW
diff --git a/uevent/uevent.c b/uevent/uevent.c
index b9e3557..e40aa2e 100644
--- a/uevent/uevent.c
+++ b/uevent/uevent.c
@@ -16,6 +16,7 @@
#include <hardware_legacy/uevent.h>
+#include <malloc.h>
#include <string.h>
#include <unistd.h>
#include <poll.h>
diff --git a/wifi/wifi.c b/wifi/wifi.c
index 87be8d8..5f24343 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <dirent.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <poll.h>
@@ -34,10 +35,9 @@
#include "cutils/misc.h"
#include "cutils/properties.h"
#include "private/android_filesystem_config.h"
-#ifdef HAVE_LIBC_SYSTEM_PROPERTIES
+
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
-#endif
extern int do_dhcp();
extern int ifc_init();
@@ -405,10 +405,8 @@ int wifi_start_supplicant(int p2p_supported)
{
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
int count = 200; /* wait at most 20 seconds for completion */
-#ifdef HAVE_LIBC_SYSTEM_PROPERTIES
const prop_info *pi;
unsigned serial = 0, i;
-#endif
if (p2p_supported) {
strcpy(supplicant_name, P2P_SUPPLICANT_NAME);
@@ -447,7 +445,6 @@ int wifi_start_supplicant(int p2p_supported)
/* Reset sockets used for exiting from hung state */
exit_sockets[0] = exit_sockets[1] = -1;
-#ifdef HAVE_LIBC_SYSTEM_PROPERTIES
/*
* Get a reference to the status property, so we can distinguish
* the case where it goes stopped => running => stopped (i.e.,
@@ -459,14 +456,12 @@ int wifi_start_supplicant(int p2p_supported)
if (pi != NULL) {
serial = __system_property_serial(pi);
}
-#endif
property_get("wifi.interface", primary_iface, WIFI_TEST_INTERFACE);
property_set("ctl.start", supplicant_name);
sched_yield();
while (count-- > 0) {
-#ifdef HAVE_LIBC_SYSTEM_PROPERTIES
if (pi == NULL) {
pi = __system_property_find(supplicant_prop_name);
}
@@ -483,12 +478,6 @@ int wifi_start_supplicant(int p2p_supported)
}
}
}
-#else
- if (property_get(supplicant_prop_name, supp_status, NULL)) {
- if (strcmp(supp_status, "running") == 0)
- return 0;
- }
-#endif
usleep(100000);
}
return -1;