atom feed12 messages in com.googlegroups.android-developers[android-developers] Re: possible to ...
FromSent OnAttachments
Mast3rpyr0Oct 16, 2008 9:25 pm 
shailesh prakashOct 16, 2008 9:32 pm 
Mast3rpyr0Oct 16, 2008 9:51 pm 
hackbodOct 16, 2008 11:03 pm 
shailesh prakashOct 16, 2008 11:53 pm 
Mast3rpyr0Oct 17, 2008 7:59 pm 
hackbodOct 17, 2008 11:32 pm 
eOct 18, 2008 5:01 am 
Mast3rpyr0Oct 18, 2008 1:43 pm 
hackbodOct 19, 2008 12:09 pm 
jNov 4, 2008 10:19 am 
forrestxuNov 15, 2008 6:37 pm 
Subject:[android-developers] Re: possible to lock device?
From:Mast3rpyr0 (Mast@gmail.com)
Date:Oct 18, 2008 1:43:02 pm
List:com.googlegroups.android-developers

i added device_power but doesnt seem to do anything.

On Oct 18, 8:01 am, e <enu1@gmail.com> wrote:

im have error

10-18 17:27:58.569: ERROR/AndroidRuntime(204): Uncaught handler: thread main exiting due to uncaught exception 10-18 17:27:58.581: ERROR/AndroidRuntime(204): java.lang.SecurityException: Neither user 10017 nor current process has android.permission.DEVICE_POWER. 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.os.Parcel.readException(Parcel.java:1234) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.os.Parcel.readException(Parcel.java:1222) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.os.IPowerManager$Stub$Proxy.goToSleep(IPowerManager.java:175) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.os.PowerManager.goToSleep(PowerManager.java:364) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at aexp.phoneintent.MyPhoneStateListener.onCallStateChanged(MyPhoneStateListener.java: 114) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.telephony.PhoneStateListener $2.handleMessage(PhoneStateListener.java:254) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.os.Handler.dispatchMessage(Handler.java:88) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.os.Looper.loop(Looper.java:123) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at android.app.ActivityThread.main(ActivityThread.java:3742) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at java.lang.reflect.Method.invokeNative(Native Method) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at java.lang.reflect.Method.invoke(Method.java:515) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:739) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497) 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at dalvik.system.NativeStart.main(Native Method)

im using permission

<uses-permission android:name="android.permission.WAKE_LOCK"></uses- permission> <uses-permission android:name="android.permission.DEVICE_POWER"></uses- permission> On Oct 18, 11:32 am, hackbod <hack@gmail.com> wrote:

Take a look in the log and see if there is an error message about not having a permission; I would assume that there is a permission needed to do this.

On Oct 17, 7:59 pm, Mast3rpyr0 <Mast@gmail.com> wrote:

hmm that didnt seem to work right, i ran using the debugger and it did infact run the method but nothing; heres what i got:

final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); ... if(lock.equals("lock"))                                                 {                                                         pm.goToSleep(10000);                                                 }

On Oct 17, 2:53 am, "shailesh prakash" <shai@gmail.com> wrote:

Sure it does, but if your phone is stolen then it should wake up in password lock mode and ack should send to alternative number or mail with gps location and cell ID(network operator's cell).

On Fri, Oct 17, 2008 at 11:34 AM, hackbod <hack@gmail.com> wrote:

I believe PowerManager.goToSleep() should lock the device as part of putting it to sleep:

On Oct 16, 9:51 pm, Mast3rpyr0 <Mast@gmail.com> wrote:

hmm i wish there was a simple lockDevice() method :P this is the last thing i need before i want to release my app. it goes out for a closed beta on the 22nd.

On Oct 17, 12:33 am, "shailesh prakash" <shai@gmail.com> wrote:

Hey Mast3rpyr0,

I did try it earlier but drop in between. I had plans to do it like this,     Send SMS, broadcast receiver will listen it and open msg read content match with data in SQLite database and change phone state accordingly. I implemented till the last and most tedious task, changing phone state. Hope it will help you in some extent

On Fri, Oct 17, 2008 at 9:56 AM, Mast3rpyr0 <Mast@gmail.com> wrote:

Im working on a security app that allows a user to track their phone on a web site if they lose the phone or it is stolen. I already have the part working where i could do this if a user selected lock on the site but once the device gets this data, how can i have the device go into the locked state like if the end call button was pressed and ask for the patern if the user set one up?