configurable vibration patterns for haptics

by wen yi » Tue, 12 May 2009 03:44:11 GMT

Sponsored Links

In the new Cupcake release, APIs are added in the framework to
facilitate widget level haptics. The new design makes it easy to
implement haptics feedbacks consistent across applications from ISPs.
I especially liked the idea that the types of feedback are linked to
vibration patterns with an index. It is now possible to customize the
haptics patterns for use cases and hardwares.

I am wondering if it is worthwhile to use a configuration file to map
the haptics index to vibration patterns. That setup allow customizing
of the patterns without changing code.

I noticed that the timing control in the vibratePatther thread in sometimes is less than exact. Wondering if it
makes sense to move that logic into HAL or even device driver.

It appears that View.performHapticFeedback() is merely routed through
WindowManagerService, PhonePolicyManager and to Vibrator. Functional
wide it sounds equivalent to calling Vibrator.vibratorPattern()
directly in View class. Wondering if new fucntionality will be added
on in future releases and what it will be.


- Wen

configurable vibration patterns for haptics

by Dianne Hackborn » Fri, 22 May 2009 02:29:24 GMT


If we want to really embrace using the vibrator for haptic feedback, then I
certainly think it would be good to have a way to configure it with
different patterns by indices.  I wonder how much you think the approach of
using the vibrator is really worth though -- the current generic
implementation is only done for long presses, where accuracy is really not
needed at all.  However, when we use it for example in the keyboard on some
devices the vibrator is so "mushy" that the effect isn't really all that

As far as the timing, yes this definitely needs to be improved.  I think
your idea of being able to submit the pattern to the HAL layer for it to do
the timing would be great.

Even better, I think, would be to have a driver for this as you suggest, and
just let each process open it and submit patterns to it.  This would require
that each process hold the vibrator permission though...  we'd need to
decide how much it is worth having that permission vs. having some other
scheme for accessing the hardware.  For example, an extravagant approach
could be to have the driver keep track of each client, with the window
manager able to tell it which of those is allowed to vibrate based on which
ones have visible windows.

The reason for the current routing through the window manager is that this
allows the window manager to do just this kind of control, rejecting calls
from windows that are not visible.  (Plus it allows customization in the
PhoneWindowManager, to use other hardware besides the vibrator that might be
available for haptics.)  But yeah, this is a pretty excessive amount of
overhead just to do haptics.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. How to set up the execution classpath for custom deployed jars


I'm trying to port OSGi to Android. I've been successful by copying
the OSGi framework to the directory /data/osgi in the Android emulator
(after some fixes) and I can execute OSGi with the Android shell.

Now, I want to progress a bit more and add Android support. I plan to
create an Android application which launches the OSGi framework, but I
wouldnt like to bundle all the OSGi jars into the Android
applications. I would like that these jars keep located in the /data/
osgi directory. The problem is how to set up the Android application
classpath so that the application can access to the OSGi classes.

I've seen that you can specify the classpath for Android libraries
(e.g. maps) but it's not a full path, and it looks like I need a
classpath with several full paths pointing to /data/osgi.

Any help will be welcome.

Thank you in advance,


2. browser intent messages and broadcastReceiver

Hi. Please tell me how to receive (with a BroadcastReceiver)  intent 
messages from the browser application. Currently my manifest code 
snippet looks like this:

        <receiver android:name=".receiver.BrowseReceiver">
                <action android:name="android.intent.action.VIEW" />
android:name="android.intent.category.BROWSABLE" />
                <action android:name="android.intent.action.SEARCH" />
                <action android:name="android.intent.action.WEB_SEARCH" />
                <intent-filter> action 
android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
android:name="android.intent.category.BROWSABLE" />
android:name="android.intent.browser.BrowserActivity" />
                <action android:name="android.intent.action.WEB_SEARCH" 
                android:name="android.intent.action.SEARCH" /> 

Does anyone have a solution for this?



3. The app got crashed on SDK 1.5 which is working fine on SDK 1.0

4. Writting/Reading Sync settings - Possible?

5. android create avd - usage in ant

6. Redial

7. bandwidth monitoring per process