}
}
+ void updateOptionsLocked(ActivityOptions options) {
+ if (options != null) {
+ if (pendingOptions != null) {
+ pendingOptions.abort();
+ }
+ pendingOptions = options;
+ }
+ }
+
void applyOptionsLocked() {
if (pendingOptions != null) {
final int animationType = pendingOptions.getAnimationType();
}
}
+ ActivityOptions takeOptionsLocked() {
+ ActivityOptions opts = pendingOptions;
+ pendingOptions = null;
+ return opts;
+ }
+
void removeUriPermissionsLocked() {
if (uriPermissions != null) {
uriPermissions.removeUriPermissionsLocked();
int taskTopI = -1;
int replyChainEnd = -1;
int lastReparentPos = -1;
+ ActivityOptions topOptions = null;
+ boolean canMoveOptions = true;
for (int i=mHistory.size()-1; i>=-1; i--) {
ActivityRecord below = i >= 0 ? mHistory.get(i) : null;
}
int dstPos = 0;
ThumbnailHolder curThumbHolder = target.thumbHolder;
+ boolean gotOptions = !canMoveOptions;
for (int srcPos=targetI; srcPos<=replyChainEnd; srcPos++) {
p = mHistory.get(srcPos);
if (p.finishing) {
+ " out to target's task " + target.task);
p.setTask(target.task, curThumbHolder, false);
curThumbHolder = p.thumbHolder;
+ canMoveOptions = false;
+ if (!gotOptions && topOptions == null) {
+ topOptions = p.takeOptionsLocked();
+ if (topOptions != null) {
+ gotOptions = true;
+ }
+ }
if (DEBUG_ADD_REMOVE) {
RuntimeException here = new RuntimeException("here");
here.fillInStackTrace();
replyChainEnd = targetI;
}
ActivityRecord p = null;
+ boolean gotOptions = !canMoveOptions;
for (int srcPos=targetI; srcPos<=replyChainEnd; srcPos++) {
p = mHistory.get(srcPos);
if (p.finishing) {
continue;
}
+ canMoveOptions = false;
+ if (!gotOptions && topOptions == null) {
+ topOptions = p.takeOptionsLocked();
+ if (topOptions != null) {
+ gotOptions = true;
+ }
+ }
if (finishActivityLocked(p, srcPos,
Activity.RESULT_CANCELED, null, "reset", false)) {
replyChainEnd--;
target = below;
targetI = i;
}
-
+
+ if (topOptions != null) {
+ // If we got some ActivityOptions from an activity on top that
+ // was removed from the task, propagate them to the new real top.
+ if (taskTop != null) {
+ taskTop.updateOptionsLocked(topOptions);
+ } else {
+ topOptions.abort();
+ }
+ }
+
return taskTop;
}
if (r.finishing) {
continue;
}
+ ActivityOptions opts = r.takeOptionsLocked();
+ if (opts != null) {
+ ret.updateOptionsLocked(opts);
+ }
if (finishActivityLocked(r, i, Activity.RESULT_CANCELED,
null, "clear", false)) {
i--;