JankBenchX icon indicating copy to clipboard operation
JankBenchX copied to clipboard

Permission error on Android 13

Open xNombre opened this issue 2 years ago • 1 comments

Hi, this app doesn't work on Android 13. Logcat output:

02-14 00:25:25.239 1618 4376 W InputManager: Permission Denial: injectInputEvent() from pid=4726, uid=10329 requires android.permission.INJECT_EVENTS

02-14 00:25:25.240 4726 4854 E AndroidRuntime: FATAL EXCEPTION: AutomatorThread 02-14 00:25:25.240 4726 4854 E AndroidRuntime: Process: com.android.benchmark, PID: 4726 02-14 00:25:25.240 4726 4854 E AndroidRuntime: java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission. 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Parcel.createExceptionOrNull(Parcel.java:3028) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:3012) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:2995) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:2937) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.hardware.input.IInputManager$Stub$Proxy.injectInputEventToTarget(IInputManager.java:1294) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1151) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.app.Instrumentation.syncInputTransactionsAndInjectEventIntoSelf(Instrumentation.java:1196) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.app.Instrumentation.sendPointerSync(Instrumentation.java:1181) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at com.android.benchmark.ui.automation.Automator$AutomatorHandler.doInteraction(Automator.java:175) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at com.android.benchmark.ui.automation.Automator$AutomatorHandler.nextInteraction(Automator.java:151) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at com.android.benchmark.ui.automation.Automator$AutomatorHandler.handleMessage(Automator.java:117) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace: 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at com.android.server.input.InputManagerService.injectInputEventToTarget(InputManagerService.java:877) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:617) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Binder.execTransactInternal(Binder.java:1283) 02-14 00:25:25.240 4726 4854 E AndroidRuntime: at android.os.Binder.execTransact(Binder.java:1227)

xNombre avatar Feb 13 '23 23:02 xNombre

I apologize for the late response. I tried to add the required INJECT_EVENTS permissions, but it seems to be granted only to system apps. I'm not sure what's the best way to fix this issue in a way that's easy for users to install and use the app. I'm open to any suggestions, and happy to accept pull requests

screenshot

Related: https://issuetracker.google.com/issues/244970399?pli=1

joshchoo avatar Mar 18 '23 00:03 joshchoo