Skip to content

Commit

Permalink
Ungrab volume keys when music playback is active
Browse files Browse the repository at this point in the history
As there is no direct music playback is active information available,
heuristics based on volume limit audio policy decisions are used.

Based on that the volume keys are ungrabbed even if display is off or
ui is locked.

Also parsing of audio routing was changed, now all sink devices that
have name like "xxxforcall" are considered the same as "xxx". This
should make headset detection work the same whether "forcall" type
sinks are needed in the device or not.

[mce] Ungrab volume keys when music playback is active
  • Loading branch information
spiiroin committed Mar 11, 2014
1 parent 3de6bd2 commit 3089918
Show file tree
Hide file tree
Showing 4 changed files with 512 additions and 316 deletions.
3 changes: 3 additions & 0 deletions mce.c
Expand Up @@ -1012,6 +1012,8 @@ int main(int argc, char **argv)
0, GINT_TO_POINTER(FALSE));
setup_datapipe(&keypad_grab_active_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(FALSE));
setup_datapipe(&music_playback_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(FALSE));
/* Initialise mode management
* pre-requisite: mce_gconf_init()
* pre-requisite: mce_dbus_init()
Expand Down Expand Up @@ -1144,6 +1146,7 @@ int main(int argc, char **argv)
free_datapipe(&touch_grab_wanted_pipe);
free_datapipe(&keypad_grab_active_pipe);
free_datapipe(&keypad_grab_wanted_pipe);
free_datapipe(&music_playback_pipe);

/* Call the exit function for all subsystems */
mce_gconf_exit();
Expand Down
3 changes: 3 additions & 0 deletions mce.h
Expand Up @@ -371,6 +371,9 @@ datapipe_struct keypad_grab_wanted_pipe;
/** keypad input grab active; read only */
datapipe_struct keypad_grab_active_pipe;

/** music playback active; read only */
datapipe_struct music_playback_pipe;

/* XXX: use HAL */
/** Does the device have a flicker key? */
extern gboolean has_flicker_key;
Expand Down

0 comments on commit 3089918

Please sign in to comment.