Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haptic: Use event configuration based haptic event type detection #45

Merged
merged 1 commit into from Jul 23, 2014

Conversation

kjokinie
Copy link
Contributor

The ffmemless plugin was using effect configuration based *_TOUCH key
to detect if effect is touch interaction related to filter it out
in case touch haptics is disabled from profile. This got broken when
the can_handle policy was moved to haptic.c. And also it was never
working for android vibrator plugin.

Fixed the touch haptic detection by replacing the ffmemless specific
key with a event configuration based "haptic.type" key that will apply
right policy to all vibra plugins utilizing n_haptic_can_handle function.

The haptic.key currently supports type strings "alarm" and "touch". This
may be appended in the future if there is some need.

Currently default policy does not block haptic playback if "haptic.type"
key is missing for event, but it may be used for that in the future to
for example move the call state handling from haptic.c to event
configuration files, like it's done for audio now.

Signed-off-by: Kalle Jokiniemi kalle.jokiniemi@jolla.com

*/
#define HAPTIC_TYPE_KEY "haptic.type"

/* Convinience macros for supported haptic types */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: "Convenience"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix.

@thp
Copy link
Contributor

thp commented Jul 23, 2014

Some minor comments, please have a look. Other than that, looks good. Is there also a PR for the droid vibrator plugin?

@kjokinie
Copy link
Contributor Author

The droid vibrator plugin will work as it is now. No changes needed there.

The ffmemless plugin was using effect configuration based *_TOUCH key
to detect if effect is touch interaction related to filter it out
in case touch haptics is disabled from profile. This got broken when
the can_handle policy was moved to haptic.c. And also it was never
working for android vibrator plugin.

Fixed the touch haptic detection by replacing the ffmemless specific
key with a event configuration based "haptic.type" key that will apply
right policy to all vibra plugins utilizing n_haptic_can_handle function.

The haptic.key currently supports type strings "alarm" and "touch". This
may be appended in the future if there is some need.

Currently default policy does not block haptic playback if "haptic.type"
key is missing for event, but it may be used for that in the future to
for example move the call state handling from haptic.c to event
configuration files, like it's done for audio now.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jolla.com>
@kjokinie
Copy link
Contributor Author

Previous commented issues fixed now.

@thp
Copy link
Contributor

thp commented Jul 23, 2014

LGTM.

kjokinie pushed a commit that referenced this pull request Jul 23, 2014
haptic: Use event configuration based haptic event type detection
@kjokinie kjokinie merged commit 9eb8818 into nemomobile:master Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants