touch 이벤트가 발생하면 강제로 화면에 특정 부분을 클릭하는 어플을 만들고 있습니다. 

화면의 특정 부분을 클릭하는 부분의 소스는 


Instrumentation inst = new Instrumentation();

       long downTime = SystemClock.uptimeMillis();

       long eventTime = SystemClock.uptimeMillis();

       MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, touchPosX,touchPosY, 0);

       MotionEvent event2 = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, touchPosX, touchPosY, 0);

       inst.sendPointerSync(event);

       inst.sendPointerSync(event2);


다음과 같습니다. 

문제는 이 소스를 Service 부분에 실행하는데 이러한 에러가 납니다.


08-02 22:20:58.565: E/AndroidRuntime(9960): FATAL EXCEPTION: Thread-13

08-02 22:20:58.565: E/AndroidRuntime(9960): java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission

08-02 22:20:58.565: E/AndroidRuntime(9960): at android.os.Parcel.readException(Parcel.java:1322)

08-02 22:20:58.565: E/AndroidRuntime(9960): at android.os.Parcel.readException(Parcel.java:1276)

08-02 22:20:58.565: E/AndroidRuntime(9960): at android.view.IWindowManager$Stub$Proxy.injectPointerEvent(IWindowManager.java:998)

08-02 22:20:58.565: E/AndroidRuntime(9960): at android.app.Instrumentation.sendPointerSync(Instrumentation.java:902)

08-02 22:20:58.565: E/AndroidRuntime(9960): at com.example.widgetapp.TestMain.TouchEventExec(TestMain.java:139)

08-02 22:20:58.565: E/AndroidRuntime(9960): at com.example.widgetapp.TestMain$1$1.run(TestMain.java:94)


고수님들의 조언 부탁 드립니다 ~