damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.42k stars 804 forks source link

Allow phone to be switched to Vibrate #220

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

There is currently an API call which allows the phone to be toggled to silent 
mode and to check if its is in silent mode.  Please create another API call to 
also be able to check if the phone is in vibrate mode and to toggle vibrate 
mode.

Thanks

Original issue reported on code.google.com by nekta...@gmail.com on 25 Aug 2010 at 3:23

Copied from original issue: damonkohler/android-scripting#408

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

I've done a trial implementation of getVibrateMode and toggleVibrateMode in 
clone
rjmatthews62-android-scripting

The way the SDK is written, you have to pass what Vibrate Type you are 
referring to:
VIBRATE_TYPE_RINGER or VIBRATE_TYPE_NOTIFICATION.
I've implemented this as a boolean argument (ringer) but there's an argument 
for creating separate getVibrateRinger and getVibrateNotify methods. I am open 
to suggestions...

Original comment by rjmatthews62 on 19 Dec 2010 at 12:51

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

Related to this, I think the current checkRingerSilentMode is "broken". When 
Silent Mode is on but Vibrate is on, checkRingerSilentMode returns false. Maybe 
there should just be a single getSilentMode that returns an enum of the 
possible states that includes Vibrate.

Original comment by mdgro...@gmail.com on 29 Jan 2011 at 11:58

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

The "trial implementation" of toggleVibrateMode doesn't seem to work.

Original comment by jglossin...@gmail.com on 23 Nov 2011 at 1:52

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

I tried toggleVibrateMode in the Python interpreter, and it didn't work for me 
either. I noticed later that day that my phone no longer vibrates for 
notifications, which I'm guessing was caused by toggleVibrateMode. 
Unfortunately, because I didn't notice the problem until several hours later, I 
don't have log data. I submitted an issue on Py4A's Google Code page but 
haven't received a response. See Py4A Issue 36 for more details: 
http://code.google.com/p/python-for-android/issues/detail?id=36&sort=-id

Thanks in advance for any help!

Original comment by armadaje...@gmail.com on 12 Dec 2011 at 5:52