I know that this is not the first Thread about this permission, however the other ones aren't finished or don't help me.
What I need is to inflate KeyEvents using Instrumentation. That works great and is insanely faster than the shell ("input keyevent ") method. But if I want to inject to other apps I catch a SecurityException. That didn't surprise me to much so I added <uses-permission android:name="android.permission.INJECT_EVENTS" />
to my manifest. Eclipse stops to debug this telling me that only system apps can use this permission. So I compiled using the signed apk tool and pushed that apk to /system/app. Rebooted, and guess what
W/PackageManager( 3499): Not granting permission android.permission.INJECT_EVENTS to package com.<....> (protectionLevel=2 flags=0x8be45)
The app is targeted for only one special device. So I know all the specs and it is rooted. But su
injection-commands take to long and SuperUser is required. I would love to do that with Instrumentation or maybe there is something else I should try?
The firmware is not written by me, so I don't have the platform key.
Thanks for your help!
EDIT: Got the platform keys (The dev used the normal Google ones), signed and aligned, then pushed the apk to /system/app. Also added android:sharedUserId="android.uid.system"
to my manifest. On Boot there is no longer the logcat message. However when I want to send the keysync I still catche the SecurityException
. Any ideas?
EDIT2: Here is an excerpt from ps
. Seems like the package ist not listed as system
u0_a108 5241 2399 492044 48968 ffffffff 40113ab0 S com.mypackage