Search code examples
javaandroidandroid-sourcelockscreen

SlidingTab on Lock Screen vibrates when unlocking - regardless of the global settings about haptic feedback


When unlocking my android 2.3.3 phone at the simple lock screen it vibrates once the slider is touched and a second time a little longer when the slider has been pulled completely to the other side.

I found it a little annoying and so I thought I could somehow switch it off in the settings as I can switch off any other vibration.

There are actually two categories which might make sense in this case:

1) Sound Settings/General/Vibrate with the individual settings: (always, never, only in silent mode, only when not in silent mode) 2) Sound Settings/Feedback/Haptic Feedback (on/off)

I had to find out, that none of these settings have an impact on the unlocking action mentioned above.

So I googled and found some comments about the fact, that the vibration cannot be switched off easily in the settings.

e.g. http://code.google.com/p/android/issues/detail?id=34040

Now I got curious and I tried to dive in a little deeper into the android sources and found the source for the slider here: https://github.com/android/platform_frameworks_base/blob/master/core/java/com/android/internal/widget/SlidingTab.java

see:

vibrate(VIBRATE_SHORT);

and:

vibrate(VIBRATE_LONG);

It seems to me that the vibrate action is called regardless of any settings.

Now I have some questions:

  1. Shouldn't the vibration for unlocking consider the settings from either 1) or 2) above?

  2. How would this be added to the source code and how would this change be applied to the android source repository so that some time later this could be migrated into the next android (if the sliding tab is used there at all)

  3. Would it be possible to update the file SlidingTab.java seperately and test it on my rooted device or would it be necessary to do the complete make for the whole android system and flash my mobile phone with the new system in order to see if it works?

  4. I have found other mobile phones with the same slider and no vibration when unlocking. I am clueless how this can be after I found the prove that it is not able to switch off the vibration in the source code.

thank you for sharing your knowledge with me

Nils


Solution

    1. It may be consider or may not.
    2. Not sure here.
    3. If you need to change lock screen at all you can find various implementation. If you need to change default lock screen you need to build entire system.
    4. Every companies customise Android for the phones. Therefore some sliders may have no vibration. Or the phone may have no hardware for it.