Sending the System Broadcast Intents !!!

2,682 views
Skip to first unread message

Rajesh Kumar

unread,
Jan 24, 2011, 3:42:32 PM1/24/11
to android-...@googlegroups.com
Hi,

     I need to broadcast few of the below system intents, but there is some issues..

1) android.intent.action.BATTERY_CHANGED
#Intent;action=android.intent.action.BATTERY_CHANGED;launchFlags=0x60000000;B.present=true;i.scale=100;i.level=50;i.status=2;i.plugged=2;i.health=2;end

Issue: "java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.BATTERY_CHANGED"
         How to overcome this issue, any keystore do we need to use it to achieve this??

2) Similarly,

#Intent;action=android.intent.action.DEVICE_STORAGE_OK;end
Issue: "java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.DEVICE_STORAGE_OK"

and

#Intent;action=android.intent.action.SCREEN_OFF;launchFlags=0x40000000;end
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.SCREEN_OFF

So please let me know, how to sign the app or what else do we need to do for this.

Regards,
Rajesh Kumar


Goodwin

unread,
Jan 27, 2011, 1:06:04 AM1/27/11
to android-platform
It seems the Permission issue.
You can add the permission in you android.manifest.xml.

On 1月25日, 上午4时42分, Rajesh Kumar <rajeshsinc...@gmail.com> wrote:
> *Hi,*
>
> I need to broadcast few of the below system intents, but there is some
> issues..
>
> 1) android.intent.action.BATTERY_CHANGED
> #Intent;action=android.intent.action.BATTERY_CHANGED;launchFlags=0x60000000-;B.present=true;i.scale=100;i.level=50;i.status=2;i.plugged=2;i.health=2;en-d

Dianne Hackborn

unread,
Jan 27, 2011, 1:17:17 AM1/27/11
to android-...@googlegroups.com
Those broadcasts are for the platform.  You shouldn't be sending them.  The platform sends them at the appropriate times.  If you send them independently yourself, you will conflict with the platform.


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.



--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Reply all
Reply to author
Forward
0 new messages