I could figure out why key events are not passed to status bar view.
While adding statusbar view to the window,the flag is been set as
FLAG_NOT_FOCUSABLE.
if you check out the definition for it.It clearly says, window wont
get key input focus.
FLAG_NOT_FOCUSABLE Window flag: this window won't ever get key input
focus, so the user can not send key or other button events to it.
public void systemReady() {
System.out.println("Statusbar service - systemReady ");
final StatusBarView view = mStatusBarView;
WindowManager.LayoutParams lp = new
WindowManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
view.getContext().getResources().getDimensionPixelSize(
com.android.internal.R.dimen.status_bar_height),
WindowManager.LayoutParams.TYPE_STATUS_BAR,
// WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE| // After
commenting this line i am able to receive the key events and system
launches keyboard.
WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING,
mPixelFormat);
lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
lp.setTitle("StatusBar");
lp.windowAnimations = R.style.Animation_StatusBar;
WindowManagerImpl.getDefault().addView(view, lp);
}FLAG_NOT_FOCUSABLE Window flag: this window won't ever get key
input focus, so the user can not send key or other button events to
it.
But the problem here is, other windows ( application windows ) phone
windows doesnt get focused and i couldnt do any touch events on the
screen.....:(
My question is
1 - Can window focus be changed dynamically, like when the user
touches the application window, it should get focused and when user
touches status bar, it should get focus.
If so, can you point out in the framework code where i can fix it. I
went throught WindowManager, PhoneWindowManager classes. It is pretty
huge, tough to visualise, where the sequences are defined to add the
status bar window, keuguard window, phone window, application window.
Can someone point me or give some brief explanations on this.!!
2 - Second of way of bringing solution to this is, write a seperate
activity, which shows the keyboard and when user presses done, i show
it back on the status bar. [ I havenot tried it yet, hope it works.]
- mani