I have been reading through some of the Android AOSP code as a side project, and it occurred to me that I had no idea where the code was to show the app switcher. I have grepped the source tree and done some Internet searches, but to no avail. Can somebody please point me in the right direction (file/directory/class name, etc.) I am pretty new to this, so please bear with me.
Specifically, I'm interested in the part of the code that detects a long press of Home and causes the app switcher UI to be displayed.
Home button, Long press of home key, power key are all handled in frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
You can check handleLongPressOnHome
function in above source where RecentApplicationsDialog is being shown.
The function I have mentioned is from ICS code.