From my understanding, the soft keyboard is actually a dialog window that underlies all other apllication windows. When an application asks for the keyboard, the app's ViewRoot (and Window) is resized to the top of the screen which allows the keyboard to be visible.
So far so good...
What I don't understand is how the key preview (that blue-ish view that shows the enlarged pressed key - it's actually a TextView) shows up on top of the app's window. After all,the keyboard's window sits below the app's window so I would assume that any view that is created on that window would only exist behind the app's window.. Does this preview TextView have any special characteristics? Is the z-order of the views decided upon according to the order of their creation? (so even though two views are drawn to the same surface, their z-order is different?)
As it turns out, the keyboard's layout it actually on top. Although the its window may have been created before he application even started, it's a dialog window, which means it is added to the top of the windows hierarchy. The only catch here is that the keyboard's window is the size of the entire screen (keyboard is drawn at the bottom and a black background above it). Since its window is the top window, one would expect the keyboard's black background to come on top of the application that activated it...
Solution: the keyboard's window has a translucent property! As it turns out the black background is not drawn due to this fact which means that whatever the application was showing can be seen. It took me quite sometime to figure that one out...