diff options
| author | 2015-12-15 16:35:38 -0800 | |
|---|---|---|
| committer | 2015-12-15 16:35:38 -0800 | |
| commit | a8e98b9e8a97ef18ea673d552bed79e453dc96f4 (patch) | |
| tree | 89d0f0fb2a7d7f9ca0b9211b845bcf18413f2cfa | |
| parent | e27a3025ac750b9a51891028f9a422ac61a19c3c (diff) | |
Refactoring of ASS.startActivityUncheckedLocked.
Remove 3 levels of unnecessary indentation in an if.
Change-Id: Ief38db3bebbcb44a9a9b5e0dfa5dbf487a0a49ab
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index be2c49a91eb8..771e1823b176 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -2210,7 +2210,7 @@ public final class ActivityStackSupervisor implements DisplayListener { ActivityInfo newTaskInfo = null; Intent newTaskIntent = null; - ActivityStack sourceStack; + final ActivityStack sourceStack; if (sourceRecord != null) { if (sourceRecord.finishing) { // If the source is finishing, we can't further count it as our source. This @@ -2440,33 +2440,27 @@ public final class ActivityStackSupervisor implements DisplayListener { // once. ActivityStack topStack = mFocusedStack; ActivityRecord top = topStack.topRunningNonDelayedActivityLocked(notTop); - if (top != null && r.resultTo == null) { - if (top.realActivity.equals(r.realActivity) && top.userId == r.userId) { - if (top.app != null && top.app.thread != null) { - if ((launchFlags & Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0 - || launchSingleTop || launchSingleTask) { - ActivityStack.logStartActivity(EventLogTags.AM_NEW_INTENT, top, - top.task); - // For paranoia, make sure we have correctly - // resumed the top activity. - topStack.mLastPausedActivity = null; - if (doResume) { - resumeTopActivitiesLocked(); - } - ActivityOptions.abort(options); - if ((startFlags&ActivityManager.START_FLAG_ONLY_IF_NEEDED) != 0) { - // We don't need to start a new activity, and - // the client said not to do anything if that - // is the case, so this is it! - return ActivityManager.START_RETURN_INTENT_TO_CALLER; - } - top.deliverNewIntentLocked(callingUid, r.intent, r.launchedFromPackage); - return ActivityManager.START_DELIVERED_TO_TOP; - } - } + final boolean dontStart = top != null && r.resultTo == null + && top.realActivity.equals(r.realActivity) && top.userId == r.userId + && top.app != null && top.app.thread != null + && ((launchFlags & Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0 + || launchSingleTop || launchSingleTask); + if (dontStart) { + ActivityStack.logStartActivity(EventLogTags.AM_NEW_INTENT, top, top.task); + // For paranoia, make sure we have correctly resumed the top activity. + topStack.mLastPausedActivity = null; + if (doResume) { + resumeTopActivitiesLocked(); + } + ActivityOptions.abort(options); + if ((startFlags & ActivityManager.START_FLAG_ONLY_IF_NEEDED) != 0) { + // We don't need to start a new activity, and the client said not to do + // anything if that is the case, so this is it! + return ActivityManager.START_RETURN_INTENT_TO_CALLER; } + top.deliverNewIntentLocked(callingUid, r.intent, r.launchedFromPackage); + return ActivityManager.START_DELIVERED_TO_TOP; } - } else { if (r.resultTo != null && r.resultTo.task.stack != null) { r.resultTo.task.stack.sendActivityResultLocked(-1, r.resultTo, r.resultWho, |