I know that this is not the first topic about this permission, but others are not finished or do not help me.
I need to inflate KeyEvents using Instrumentation. This works great and is insanely faster than the shell ("input keyevent") method. But if I want to add to other applications, I will catch a SecurityException. This did not surprise me, so I added <uses-permission android:name="android.permission.INJECT_EVENTS" /> to my manifest. Eclipse stops debugging this, saying that only system applications can use this permission. So I compiled using the signed apk tool and clicked on apk in / system / app. Reboot and guess what
W/PackageManager( 3499): Not granting permission android.permission.INJECT_EVENTS to package com.<....> (protectionLevel=2 flags=0x8be45)
The application is intended for only one special device. Therefore, I know all the specifications and is rooted. But su injection teams are time consuming and SuperUser is required. I would like to do this with Instrumentation or maybe there is something else that I should try?
The firmware is not written by me, so I do not have a platform key.
Thank you for your help!
EDIT: got the platform keys (Dev used regular Google), signed and aligned, and then pushed apk to / system / app. Also added android:sharedUserId="android.uid.system" to my manifest. Boot no longer has a logcat message. However, when I want to send keysync, I still subtract SecurityException . Any ideas?
EDIT2: Here is an excerpt from ps . It looks like the package is missing from the system
u0_a108 5241 2399 492044 48968 ffffffff 40113ab0 S com.mypackage
source share