0

I am working with testing android app's power consumption and to make the app consump most power as possible,I want to send a system broadcast like "android.intent.action.PACKAGE_ADD",but the system reboot when I send it by adb shell am broadcast command.

So is there any method to send a system broadcast?

Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
hunt
  • 11
  • 1

1 Answers1

-2

I think you can see here sulution:

Some themes in StackOverflow

One simple tutorial

more detail you can see in official documentation developer.andorid

Community
  • 1
  • 1
ar_gentum
  • 1
  • 2
  • thanks for your answers, but I want to send some system broadcast ,broadcasts like "android.intent.action.CALL" can be sent by adb shell command,but others like "android.net.conn.CONNECTIVITY_CHANGE" cann't be sent by app,the device would reboot or exception "java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.PACKAGE_ADDED" – hunt May 05 '15 at 09:02
  • Some broadcasts are protected. See: https://android.googlesource.com/platform/frameworks/base/+/master/core/res/AndroidManifest.xml#130 Maybe you bradcasted android.intent.action.CALL on an Android < N? That would explain why that protected broadcast would work. – Alix Jul 31 '19 at 13:42