开发者

How to disable mic, camera and any other tool

What I am trying to achieve over here is, I want to disable wi-fi, camera, mic and every possible tool of communication on the phone when my app ge开发者_JS百科ts launched.

I got code for disabling wifi, which works good http://androidsnips.blogspot.com/2010/09/turn-off-on-wifi-in-android-using-code.html

The other one is for disabling bluetooth How to enable/disable bluetooth programmatically in android

I am not getting anything related to camera, mic or any possible stuff.

I hope someone can help :)

Thanks very much in advance.


The Camera class comes locked to your process when you access it for the first time, and there are methods lock() and unlock() - so that means that no other process could use that device while your app has the camera locked, I guess. I doubt there's a way of getting rid of microphone input due to the ability for you to interfere with calls if you had that device locked.


I have got work around for disabling camera.

From 2.2, we can kill the process (not recommended, but I had no choice), so what I did was, when my condition = true, I kill the process.

Other tricky thing would be, when your condition = true, pass an intent to go to HOME and finish the activity, this worked well too for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜