Above is the 9patch you can use for keyboards and dialogs. In this same vein you make the focus indicator 9patch you want except make it a more squashed rectangle not so tall. Corners not so big. Maybe 4-5x wider than it is in height.
The 9patch above grows/shrinks just fine as the dialog background (which shows for keyboards too). Color/Darken/Lighten/Resize as needed. This is a PNG with opacity.
Notice the edge is the edge. There is no 1 pixel border extra anything. WYSIWYG. Wizzy Wig. What you see is what you get.
The 9patch is a fancy way to say "it notices the corners". The only special things about a 9patch is the rounded corners. The rest is just a simple rectangle. Keep your edges as the edges. Only does the edge change at the corners. You can be as elaborate as you like in these 9patch. This is of course just a simple example to illustrate where you are making a mistake. From here you should be able to understand this completely and go wild design your 9patch of your dreams.