Merge "Fix null ActivityOptions when starting an Activity in a new Process."
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 645a5e8..77f5c59 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -688,7 +688,8 @@
}
void applyOptionsLocked() {
- if (pendingOptions != null) {
+ if (pendingOptions != null
+ && pendingOptions.getAnimationType() != ActivityOptions.ANIM_SCENE_TRANSITION) {
final int animationType = pendingOptions.getAnimationType();
switch (animationType) {
case ActivityOptions.ANIM_CUSTOM:
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 25292a0..3db3a26 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1145,7 +1145,7 @@
mWindowManager.setAppVisibility(r.appToken, true);
}
if (r != starting) {
- mStackSupervisor.startSpecificActivityLocked(r, false, false, null);
+ mStackSupervisor.startSpecificActivityLocked(r, false, false);
}
}
@@ -1678,6 +1678,7 @@
mService.showAskCompatModeDialogLocked(next);
next.app.pendingUiClean = true;
next.app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_TOP);
+ next.clearOptionsLocked();
next.app.thread.scheduleResumeActivity(next.appToken, next.app.repProcState,
mService.isNextTransitionForward(), resumeAnimOptions);
@@ -1703,7 +1704,7 @@
next.nonLocalizedLabel, next.labelRes, next.icon, next.logo,
next.windowFlags, null, true);
}
- mStackSupervisor.startSpecificActivityLocked(next, true, false, resumeAnimOptions);
+ mStackSupervisor.startSpecificActivityLocked(next, true, false);
if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
return true;
}
@@ -1741,7 +1742,7 @@
if (DEBUG_SWITCH) Slog.v(TAG, "Restarting: " + next);
}
if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Restarting " + next);
- mStackSupervisor.startSpecificActivityLocked(next, true, true, resumeAnimOptions);
+ mStackSupervisor.startSpecificActivityLocked(next, true, true);
}
if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 9783a66..47b4d0a 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -411,7 +411,7 @@
if (hr.app == null && app.uid == hr.info.applicationInfo.uid
&& processName.equals(hr.processName)) {
try {
- if (realStartActivityLocked(hr, app, true, true, null)) {
+ if (realStartActivityLocked(hr, app, true, true)) {
didSomething = true;
}
} catch (Exception e) {
@@ -935,7 +935,7 @@
}
final boolean realStartActivityLocked(ActivityRecord r,
- ProcessRecord app, boolean andResume, boolean checkConfig, Bundle resumeArgs)
+ ProcessRecord app, boolean andResume, boolean checkConfig)
throws RemoteException {
r.startFreezingScreenLocked(app, 0);
@@ -1029,12 +1029,14 @@
}
app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_TOP);
+ Bundle options = (r.pendingOptions == null) ? null : r.pendingOptions.toBundle();
+ r.clearOptionsLocked();
app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,
System.identityHashCode(r), r.info,
new Configuration(mService.mConfiguration), r.compat,
app.repProcState, r.icicle, results, newIntents, !andResume,
mService.isNextTransitionForward(), profileFile, profileFd,
- profileAutoStop, resumeArgs);
+ profileAutoStop, options);
if ((app.info.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
// This may be a heavy-weight process! Note that the package
@@ -1108,7 +1110,7 @@
}
void startSpecificActivityLocked(ActivityRecord r,
- boolean andResume, boolean checkConfig, Bundle resumeArgs) {
+ boolean andResume, boolean checkConfig) {
// Is this activity's application already running?
ProcessRecord app = mService.getProcessRecordLocked(r.processName,
r.info.applicationInfo.uid, true);
@@ -1125,7 +1127,7 @@
// separate apk in the process.
app.addPackage(r.info.packageName, mService.mProcessStats);
}
- realStartActivityLocked(r, app, andResume, checkConfig, resumeArgs);
+ realStartActivityLocked(r, app, andResume, checkConfig);
return;
} catch (RemoteException e) {
Slog.w(TAG, "Exception when starting activity "