diff options
| author | 2014-09-18 01:36:08 +0000 | |
|---|---|---|
| committer | 2014-09-18 01:36:09 +0000 | |
| commit | 0cf001db60bd97bca26049d76723c5d99d4c5cac (patch) | |
| tree | 9b0e9b7928161e3254e0bd4ed0823675b9a2c333 | |
| parent | cc340899cb50e4fa725a82b33e05554686e9a51b (diff) | |
| parent | 47b20ba8f667a0cf3ed9a1e34c93dcfdfd50eacb (diff) | |
Merge "Protect from null Intent" into lmp-dev
| -rw-r--r-- | services/core/java/com/android/server/am/TaskRecord.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index 4de73675db02..f74b795f6314 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -327,8 +327,8 @@ final class TaskRecord { } } - if (intent != null && - (intent.getFlags()&Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0) { + final int intentFlags = intent == null ? 0 : intent.getFlags(); + if ((intentFlags & Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0) { // Once we are set to an Intent with this flag, we count this // task as having a true root activity. rootWasReset = true; @@ -338,8 +338,8 @@ final class TaskRecord { if ((info.flags & ActivityInfo.FLAG_AUTO_REMOVE_FROM_RECENTS) != 0) { // If the activity itself has requested auto-remove, then just always do it. autoRemoveRecents = true; - } else if ((intent.getFlags()&(Intent.FLAG_ACTIVITY_NEW_DOCUMENT - |Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS)) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT) { + } else if ((intentFlags & (Intent.FLAG_ACTIVITY_NEW_DOCUMENT + | Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS)) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT) { // If the caller has not asked for the document to be retained, then we may // want to turn on auto-remove, depending on whether the target has set its // own document launch mode. |