1

i'm searching for the code lines in AOSP where the KeyEvent.KEYCODE_HOME is produced. I'm pretty sure that it must be somewhere around the class PhoneStatusBar in the SystemUI package. I found the mHomeActionListener in PhoneStatusBar which is triggered by an OnTouchListener from the NavigationBarView. But there is no KeyEvent.KEYCODE_HOME produced. I was not able to find that piece of code yet. Any hints will be greatly appreciated.

Best regards

Hannes
  • 51
  • 6
  • You seem to be looking more in the areas where the event is consumed. To find the source, look for the input systems. Something will likely go through a /dev/input device, figure out if that is a generic key identity that gets mapped to this purpose later, or if it is already an Android keycode. You might also compare the source of the tools for injecting simulated events and see if you can derive any hints from that. – Chris Stratton May 31 '16 at 04:27

1 Answers1

3

Thank you guys for your hints.

I finally figured out how the KEYCODE_HOME is produced and consumed. My requirement was to disable the HOME button upon a configurable flag. The platform is a own embedded device with an adapted AOSP.

The HOME button is defined in the package SystemUI with View in NavigationBarView and OnClickListener in PhoneStatusBar. The KeyEvent.KEYCODE_HOME is produced in the InputDispatcher.cpp (inputflinger package) and passed to PhoneWindowManager.WindowManagerPolicy via interceptKeyBeforeQueueing(). The PhoneWindowManager consumes the key event and starts the HOME application(s).

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Hannes
  • 51
  • 6
  • I know this is late, but can you share the detail of how you got the instance of PhoneWindowManager. Somehow this does not show up for my dev environment. I dont believe this to be a missing library issue. – Deep Apr 12 '18 at 07:31