Hi Hackbod - sorry if I wasn't clear.  This application is to be run
in a COMPLETELY AUTOMATED mode - no humans clicking on anything.  No
humans at all - launch the app and review the results - that's it.
(It's more of a test application than a consumer application.)

What gave me hope is that there was an injectKeyEvent method on
WindowManager in the last API release.  See:
http://www.anddev.org/throwing-simulating_keystrokes_programatically-t717.html

I've tried killing the ACTION_CALL activity with finishActivity but it
doesn't work.  The system just ignores the request.

Perhaps there is another way to hang up a call in an automated way.

dreamer



On Nov 13, 4:37 pm, hackbod <[EMAIL PROTECTED]> wrote:
> Fwiw, there has never been a public API to inject a key event, except
> for the official API is on the Instrumentation class (which still
> exists).  As far as I know we don't right now have an API to get an
> Instrumentation object when not running an instrumentation test,
> though.
>
> I am a little confused about what you are asking -- you say that you
> want to send an ENDCALL to end a call, but that this is inside of the
> same application?  I believe that if your app currently has focus, the
> system will process that end call, though this is really not by
> design, but is probably not a big deal (we decide whether it is okay
> based on which window has focus so will be receiving the event...  but
> end call is special since it is intercepted by the system and never
> delivered to the focused window).  But if the user is in the in-call
> screen, then that has focus, and you can't inject a key event since
> you don't have focus.
>
> On Nov 13, 4:13 pm, dreamerBoy <[EMAIL PROTECTED]> wrote:
>
> > I'm building a test application and I have to be able to hang up a
> > call in an automated fashion.
>
> > It occurred to me that I might be able to inject a key event:
>
> >       KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN,
> > KeyEvent.KEYCODE_ENDCALL );
>
> > into the event queue somehow.
>
> > Apparently the last incarnation of the  API had an injectKeyEvent()
> > method in WindowManager but that's been stripped out.
>
> > Anyone know how to do it in 1.0?
>
> > Thanks much.
>
> > dreamer
>
>
--~--~---------~--~----~------------~-------~--~----~
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