Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ec59897 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I01e81b9c,I532c2d74

* changes:
  Add a listener when task snapshots change
  When app dies, destroy snapshot
parents 112e7e00 fb9d78af
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2176,6 +2176,12 @@ public class ActivityManager {
            dest.writeParcelable(mContentInsets, 0);
        }

        @Override
        public String toString() {
            return "TaskSnapshot{mSnapshot=" + mSnapshot + " mOrientation=" + mOrientation
                    + " mContentInsets=" + mContentInsets.toShortString();
        }

        public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() {
            public TaskSnapshot createFromParcel(Parcel source) {
                return new TaskSnapshot(source);
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.app.IStopUserCallback;
import android.app.ITaskStackListener;
import android.app.IUiAutomationConnection;
import android.app.IUidObserver;

import android.app.IUserSwitchObserver;
import android.app.Notification;
import android.app.PendingIntent;
+5 −0
Original line number Diff line number Diff line
@@ -102,4 +102,9 @@ oneway interface ITaskStackListener {
     * been locked.
     */
    void onTaskProfileLocked(int taskId, int userId);

    /**
     * Called when a task snapshot got updated.
     */
    void onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot);
}
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.app.ActivityManager.TaskSnapshot;
import android.content.ComponentName;
import android.os.RemoteException;

@@ -78,4 +79,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub {
    @Override
    public void onTaskProfileLocked(int taskId, int userId) {
    }

    @Override
    public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot)
            throws RemoteException {
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.app.ActivityManager.StackId.isHomeOrRecentsStack;
import static android.view.View.MeasureSpec;

import android.app.ActivityManager;
import android.app.ActivityManager.TaskSnapshot;
import android.app.ActivityOptions;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -60,6 +61,7 @@ import com.android.systemui.recents.events.component.RecentsVisibilityChangedEve
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
import com.android.systemui.recents.events.ui.DraggingInRecentsEndedEvent;
import com.android.systemui.recents.events.ui.DraggingInRecentsEvent;
import com.android.systemui.recents.events.ui.TaskSnapshotChangedEvent;
import com.android.systemui.recents.misc.DozeTrigger;
import com.android.systemui.recents.misc.ForegroundThread;
import com.android.systemui.recents.misc.SystemServicesProxy;
@@ -131,6 +133,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
                loader.loadTasks(mContext, plan, launchOpts);
            }
        }

        @Override
        public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) {
            EventBus.getDefault().send(new TaskSnapshotChangedEvent(taskId, snapshot));
        }
    }

    protected static RecentsTaskLoadPlan sInstanceLoadPlan;
Loading