rovo89/XposedAppSettings — pull request #35 by GermainZ (2014-03-04 17:03:53+00:00)
Title: Allows excluding apps from recents

To exclude an app from recents, we just need to set the FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag before the activity is started.

From what I see, there are two optimal places to modify the intent.
The first one is [ActivityRecord's constructor][1], the second [ActivityStack's realStartActivityLocked method][2].

I chose realStartActivityLocked because:
* It's already hooked;
* It's responsible for creating the new ActivityRecord anyway;
* Accessing the packageName is more straightforward there;
* ActivityRecord's constructor changes slightly between Android versions and expects different parameters (although the intent is always the 4th parameter,) so better be safe.

Tested and works as intended on my device.

(The last commit replaces spaces by tabs and removes trailing whitespace for consistency.)

[1]: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/com/android/server/am/ActivityRecord.java#ActivityRecord.%3Cinit%3E%28com.android.server.am.ActivityManagerService%2Ccom.android.server.am.ProcessRecord%2Cint%2Cjava.lang.String%2Candroid.content.Intent%2Cjava.lang.String%2Candroid.content.pm.ActivityInfo%2Candroid.content.res.Configuration%2Ccom.android.server.am.ActivityRecord%2Cjava.lang.String%2Cint%2Cboolean%2Ccom.android.server.am.ActivityStackSupervisor%29
[2]: (http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/com/android/server/am/ActivityStack.java#ActivityStack.realStartActivityLocked%28com.android.server.am.ActivityRecord%2Ccom.android.server.am.ProcessRecord%2Cboolean%2Cboolean%29)