Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to turn vibration on/off on Sony Smartwatch 2 (by application)?

I want to enable/disable vibration on Sony Smartwatch 2 in my app on some conditions.

Is it possible and if it so how to do that?

EDIT: I mean enable/disable it globally (notifications, incoming calls etc.), as "Vibrate" setting in SW2 menu.

like image 305
Vladimir Petrakovich Avatar asked May 23 '15 16:05

Vladimir Petrakovich


2 Answers

You might not be able to do this globally.

From the docs, the watch operates on actions from the host.

I don't have a SW2 right now but you can try to trigger the extension when you detect the device is vibrating.

This would be a start:

public class NoVibrator extends ControlExtension{


// stuff....

 @Override
    public void onStart() {
        if(hasVibrator()){
            stopVibrator();
     }
    }

}

But I suspect this only disables vibration in your app.

You might have to find an exploit to change the settings. (something like this)

like image 140
tom91136 Avatar answered Nov 14 '22 17:11

tom91136


I don't know what your conditions are but to control the vibration use these methods in the ControlExtension class:

Start:

ControlExtension.startVibrator(int onDuration, int offDuration, int repeats);

Stop:

ControlExtension.stopVibrator();

Edit 1: There is no way to configure vibration for notifications.

like image 20
Pete Avatar answered Nov 14 '22 16:11

Pete