Skip to content

Commit

Permalink
rm isTaskRoot & NEW_TASK flag from notifi open
Browse files Browse the repository at this point in the history
* Cleans up unneeded logic and confirmed no behavior changes.
* `FLAG_ACTIVITY_NEW_TASK` is not needed as `getLaunchIntentForPackage`
already defaults this.
   - See Android ASOP source code
   - Android 11 - https://cs.android.com/android/platform/superproject/+/android-11.0.0_r3:frameworks/base/core/java/android/app/ApplicationPackageManager.java;l=251
   - Android 4 - https://cs.android.com/android/platform/superproject/+/android-4.0.4_r2.1:frameworks/base/core/java/android/app/ApplicationPackageManager.java;l=121
  • Loading branch information
jkasten2 committed Feb 3, 2021
1 parent 0326d93 commit b27ac14
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2174,12 +2174,7 @@ static boolean startOrResumeApp(Activity inContext) {
logger.debug("startOrResumeApp from context: " + inContext + " isRoot: " + inContext.isTaskRoot() + " with launchIntent: " + launchIntent);
// Make sure we have a launcher intent.
if (launchIntent != null) {
if (inContext.isTaskRoot()) {
inContext.startActivity(launchIntent);
} else {
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
inContext.startActivity(launchIntent);
}
inContext.startActivity(launchIntent);
return true;
}

Expand Down

0 comments on commit b27ac14

Please sign in to comment.