Merge "Enable hid host and do clean TURN_ON" into jb-mr1-dev
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 5159cb5..6527885 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -101,7 +101,8 @@
struct audio_hw_device hw_device;
pthread_mutex_t lock; /* see note below on mutex acquisition order */
- unsigned int devices;
+ unsigned int out_device;
+ unsigned int in_device;
bool standby;
bool mic_mute;
struct audio_route *ar;
@@ -183,10 +184,10 @@
int speaker_on;
int main_mic_on;
- headphone_on = adev->devices & (AUDIO_DEVICE_OUT_WIRED_HEADSET |
+ headphone_on = adev->out_device & (AUDIO_DEVICE_OUT_WIRED_HEADSET |
AUDIO_DEVICE_OUT_WIRED_HEADPHONE);
- speaker_on = adev->devices & AUDIO_DEVICE_OUT_SPEAKER;
- main_mic_on = adev->devices & AUDIO_DEVICE_IN_BUILTIN_MIC;
+ speaker_on = adev->out_device & AUDIO_DEVICE_OUT_SPEAKER;
+ main_mic_on = adev->in_device & AUDIO_DEVICE_IN_BUILTIN_MIC;
reset_mixer_state(adev->ar);
@@ -264,7 +265,7 @@
* (speaker/headphone) PCM or the BC SCO PCM open at
* the same time.
*/
- if (adev->devices & AUDIO_DEVICE_OUT_ALL_SCO) {
+ if (adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO) {
device = PCM_DEVICE_SCO;
out->pcm_config = &pcm_config_sco;
} else {
@@ -333,7 +334,7 @@
* it greatly simplifies things to have only the main
* mic PCM or the BC SCO PCM open at the same time.
*/
- if (adev->devices & AUDIO_DEVICE_IN_ALL_SCO) {
+ if (adev->in_device & AUDIO_DEVICE_IN_ALL_SCO) {
device = PCM_DEVICE_SCO;
in->pcm_config = &pcm_config_sco;
} else {
@@ -593,20 +594,19 @@
pthread_mutex_lock(&adev->lock);
if (ret >= 0) {
val = atoi(value);
- if (((adev->devices & AUDIO_DEVICE_OUT_ALL) != val) && (val != 0)) {
+ if ((adev->out_device != val) && (val != 0)) {
/*
* If SCO is turned on/off, we need to put audio into standby
* because SCO uses a different PCM.
*/
if ((val & AUDIO_DEVICE_OUT_ALL_SCO) ^
- (adev->devices & AUDIO_DEVICE_OUT_ALL_SCO)) {
+ (adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO)) {
pthread_mutex_lock(&out->lock);
do_out_standby(out);
pthread_mutex_unlock(&out->lock);
}
- adev->devices &= ~AUDIO_DEVICE_OUT_ALL;
- adev->devices |= val;
+ adev->out_device = val;
select_devices(adev);
}
}
@@ -629,7 +629,7 @@
pthread_mutex_lock(&adev->lock);
- if (adev->screen_off && !adev->active_in && !(adev->devices & AUDIO_DEVICE_OUT_ALL_SCO))
+ if (adev->screen_off && !adev->active_in && !(adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO))
period_count = OUT_LONG_PERIOD_COUNT;
else
period_count = OUT_SHORT_PERIOD_COUNT;
@@ -677,7 +677,7 @@
}
buffer_type = (adev->screen_off && !adev->active_in) ?
OUT_BUFFER_TYPE_LONG : OUT_BUFFER_TYPE_SHORT;
- sco_on = (adev->devices & AUDIO_DEVICE_OUT_ALL_SCO);
+ sco_on = (adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO);
pthread_mutex_unlock(&adev->lock);
/* detect changes in screen ON/OFF state and adapt buffer size
@@ -897,21 +897,20 @@
value, sizeof(value));
pthread_mutex_lock(&adev->lock);
if (ret >= 0) {
- val = atoi(value);
- if (((adev->devices & AUDIO_DEVICE_IN_ALL) != val) && (val != 0)) {
+ val = atoi(value) & ~AUDIO_DEVICE_BIT_IN;
+ if ((adev->in_device != val) && (val != 0)) {
/*
* If SCO is turned on/off, we need to put audio into standby
* because SCO uses a different PCM.
*/
if ((val & AUDIO_DEVICE_IN_ALL_SCO) ^
- (adev->devices & AUDIO_DEVICE_IN_ALL_SCO)) {
+ (adev->in_device & AUDIO_DEVICE_IN_ALL_SCO)) {
pthread_mutex_lock(&in->lock);
do_in_standby(in);
pthread_mutex_unlock(&in->lock);
}
- adev->devices &= ~AUDIO_DEVICE_IN_ALL;
- adev->devices |= val;
+ adev->in_device = val;
select_devices(adev);
}
}
@@ -1254,22 +1253,6 @@
return 0;
}
-static uint32_t adev_get_supported_devices(const struct audio_hw_device *dev)
-{
- return (/* OUT */
- AUDIO_DEVICE_OUT_SPEAKER |
- AUDIO_DEVICE_OUT_WIRED_HEADSET |
- AUDIO_DEVICE_OUT_WIRED_HEADPHONE |
- AUDIO_DEVICE_OUT_ALL_SCO |
- AUDIO_DEVICE_OUT_DEFAULT |
- /* IN */
- AUDIO_DEVICE_IN_BUILTIN_MIC |
- AUDIO_DEVICE_IN_WIRED_HEADSET |
- AUDIO_DEVICE_IN_BACK_MIC |
- AUDIO_DEVICE_IN_ALL_SCO |
- AUDIO_DEVICE_IN_DEFAULT);
-}
-
static int adev_open(const hw_module_t* module, const char* name,
hw_device_t** device)
{
@@ -1284,11 +1267,10 @@
return -ENOMEM;
adev->hw_device.common.tag = HARDWARE_DEVICE_TAG;
- adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_1_0;
+ adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
adev->hw_device.common.module = (struct hw_module_t *) module;
adev->hw_device.common.close = adev_close;
- adev->hw_device.get_supported_devices = adev_get_supported_devices;
adev->hw_device.init_check = adev_init_check;
adev->hw_device.set_voice_volume = adev_set_voice_volume;
adev->hw_device.set_master_volume = adev_set_master_volume;
@@ -1306,6 +1288,8 @@
adev->ar = audio_route_init();
adev->orientation = ORIENTATION_UNDEFINED;
+ adev->out_device = AUDIO_DEVICE_OUT_SPEAKER;
+ adev->in_device = AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN;
*device = &adev->hw_device.common;
diff --git a/init.grouper.rc b/init.grouper.rc
index 0f7d24e..353aabe 100644
--- a/init.grouper.rc
+++ b/init.grouper.rc
@@ -9,6 +9,7 @@
mkdir /storage/sdcard0 0000 root root
export EXTERNAL_STORAGE /storage/sdcard0
+ export ADB_EXTERNAL_STORAGE /mnt/shell/sdcard0/0
export MULTIUSER_EXTERNAL_STORAGE /mnt/shell/sdcard0
# Support legacy paths
diff --git a/kernel b/kernel
index cc27e92..59f9cc2 100644
--- a/kernel
+++ b/kernel
Binary files differ
diff --git a/proprietary-blobs.txt b/proprietary-blobs.txt
index eb9cd49..7f29e79 100644
--- a/proprietary-blobs.txt
+++ b/proprietary-blobs.txt
@@ -14,10 +14,13 @@
# This file is generated by device/common/generate-blob-lists.sh - DO NOT EDIT
+/system/app/Gallery2.apk
+/system/app/Nfc.apk
/system/bin/btmacreader
/system/bin/glgps
/system/bin/sensors-config
/system/bin/tf_daemon
+/system/bin/whisperd
/system/etc/asound.conf
/system/etc/firmware/bcm4330.hcd
/system/etc/firmware/nvavp_os_00001000.bin
@@ -41,8 +44,11 @@
/system/lib/libcgdrv.so
/system/lib/libdrmdecrypt.so
/system/lib/libinvensense_hal.so
+/system/lib/libjni_eglfence.so
+/system/lib/libjni_mosaic.so
/system/lib/libmllite.so
/system/lib/libmplmpu.so
+/system/lib/libnfc_jni.so
/system/lib/libnvapputil.so
/system/lib/libnvasfparserhal.so
/system/lib/libnvaviparserhal.so