i added device_power but doesnt seem to do anything.

On Oct 18, 8:01 am, e <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote:
>
> > > > > I believe PowerManager.goToSleep() should lock the device as part of
> > > > > putting it to sleep:
>
> > > > >http://code.google.com/android/reference/android/os/PowerManager.html...)
>
> > > > > On Oct 16, 9:51 pm, Mast3rpyr0 <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 
> > > > >> > 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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to