The short answer is that you won't be able to do what you want to do. Only a Launcher/Car Dock/Desk Dock program can act on the Home button, and that's only when in the appropriate mode (In a car dock, in a desktop dock, or other).
Long Answer:
The Home button in Android basically has three behaviors. It can either launch the Home or launch the Car Dock or launch the Desk Dock. This is seen in:
android/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
When the Home button is hit, it tries to find out which intent to use with this function:
/**
* Return an Intent to launch the currently active dock as home. Returns
* null if the standard home should be launched.
* @return
*/
Intent createHomeDockIntent() {
Intent intent;
// What home does is based on the mode, not the dock state. That
// is, when in car mode you should be taken to car home regardless
// of whether we are actually in a car dock.
if (mUiMode == Configuration.UI_MODE_TYPE_CAR) {
intent = mCarDockIntent;
} else if (mUiMode == Configuration.UI_MODE_TYPE_DESK) {
intent = mDeskDockIntent;
} else {
return null;
}
ActivityInfo ai = intent.resolveActivityInfo(
mContext.getPackageManager(), PackageManager.GET_META_DATA);
if (ai == null) {
return null;
}
if (ai.metaData != null && ai.metaData.getBoolean(Intent.METADATA_DOCK_HOME)) {
intent = new Intent(intent);
intent.setClassName(ai.packageName, ai.name);
return intent;
}
return null;
}
So if the phone is in a car dock or a desktop dock, indeed the launcher can be bypassed. But normally, when in no such dock, the launcher will be called.
If you're curious these are the intents. They're not hard coded for specific apps, but the default app for that category will be used.
mHomeIntent = new Intent(Intent.ACTION_MAIN, null);
mHomeIntent.addCategory(Intent.CATEGORY_HOME);
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
mCarDockIntent = new Intent(Intent.ACTION_MAIN, null);
mCarDockIntent.addCategory(Intent.CATEGORY_CAR_DOCK);
mCarDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
mDeskDockIntent = new Intent(Intent.ACTION_MAIN, null);
mDeskDockIntent.addCategory(Intent.CATEGORY_DESK_DOCK);
mDeskDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);