diff options
-rw-r--r-- | audio/AudioPolicyManagerBase.cpp | 18 | ||||
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 1 | ||||
-rw-r--r-- | include/hardware_legacy/wifi_hal.h | 26 | ||||
-rw-r--r-- | include/hardware_legacy/wifi_logger.h | 1 | ||||
-rw-r--r-- | uevent/uevent.c | 1 | ||||
-rw-r--r-- | wifi/wifi.c | 15 |
6 files changed, 36 insertions, 26 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 34afc76..63db82b 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 *); @@ -200,12 +201,6 @@ typedef struct { wifi_error (* wifi_set_epno_list)(int, wifi_interface_info *, int, wifi_epno_network *, wifi_epno_handler); wifi_error (* wifi_set_country_code)(wifi_interface_handle, const char *); - wifi_error (* wifi_enable_tdls)(wifi_interface_handle, mac_addr, wifi_tdls_params *, - wifi_tdls_handler); - wifi_error (* wifi_disable_tdls)(wifi_interface_handle, mac_addr); - wifi_error (* wifi_get_tdls_status) (wifi_interface_handle, mac_addr, wifi_tdls_status *); - wifi_error (* wifi_get_tdls_capabilities)(wifi_interface_handle iface, - wifi_tdls_capabilities *capabilities); wifi_error (* wifi_get_firmware_memory_dump)( wifi_interface_handle iface, wifi_firmware_memory_dump_handler handler); wifi_error (* wifi_set_log_handler)(wifi_request_id id, wifi_interface_handle iface, @@ -221,8 +216,17 @@ typedef struct { wifi_error (* wifi_get_ring_data)(wifi_interface_handle iface, char *ring_name); wifi_error (* wifi_get_driver_version)(wifi_interface_handle iface, char **buffer, int *buffer_size); + wifi_error (* wifi_enable_tdls)(wifi_interface_handle, mac_addr, wifi_tdls_params *, + wifi_tdls_handler); + wifi_error (* wifi_disable_tdls)(wifi_interface_handle, mac_addr); + wifi_error (*wifi_get_tdls_status) (wifi_interface_handle, mac_addr, wifi_tdls_status *); + wifi_error (*wifi_get_tdls_capabilities)(wifi_interface_handle iface, + wifi_tdls_capabilities *capabilities); } 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 b91bfa2..ee8353f 100644 --- a/include/hardware_legacy/wifi_logger.h +++ b/include/hardware_legacy/wifi_logger.h @@ -303,7 +303,6 @@ wifi_error wifi_get_firmware_version(wifi_interface_handle iface, char **buffer, /* api to collect a driver version string */
wifi_error wifi_get_driver_version(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; |