did you figure out how to avoid this exception?

On Sunday, 15 July 2012 17:18:10 UTC+5:30, Alex Stockinger wrote:
>
> Hi all,
>
> I am having serious trouble JUnit testing an Activity that uses the API 
> Level 11+ Drag&Drop Framework.
>
> I am using TouchUtils.dragViewTo() to emulate a drag that in turn causes 
> the Activity under test to start a drag using the API Level 11+ call 
> View.startDrag()
>
> The test aborts with a security exception that states that INJECT_EVENTS 
> permission is required. The log entry before the exception also gives a 
> hint as to why this happend:
> 07-15 13:38:38.121: W/InputDispatcher(204): Permission denied: injecting 
> event from pid 4064 uid 10061 to window drag owned by uid 1000
>
> I also tried sending the events directly (using Instrumentation) instead 
> of using TouchUtils. It turns out the exception is thrown on the first MOVE 
> type motion event - the DOWN before the move works successfully.
>
> This brings me to an assumption: Does the new Drag&Drop framework somehow 
> use a window above the current activity to perform the drag action? Is this 
> window owned by another process than the currently running one? This would 
> at least explain why my tests are failing...
>
> Is there a way to fix this and have my tests work properly under these 
> circumstances? Or am I missing something obvious here?
>
> Thanks in advance for your help,
> Alex
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to