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

Commit 97fb03ca authored by Winson Chung's avatar Winson Chung Committed by android-build-merger
Browse files

Merge changes I28f7ac47,If075675e into oc-dev

am: 4f5c38b3

Change-Id: I21d7ad41247bf36fdc7209dbe6f2b26a86cdd26b
parents d6066c83 4f5c38b3
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ import android.view.View;

public interface RecentsComponent {
    void showRecentApps(boolean triggeredFromAltTab, boolean fromHome);
    void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
    void toggleRecents();
    void preloadRecents();
    void showNextAffiliatedTask();
    void showPrevAffiliatedTask();

+3 −3
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class PipManager implements BasePipManager {
    TaskStackListener mTaskStackListener = new TaskStackListener() {
        @Override
        public void onActivityPinned(String packageName, int taskId) {
            if (!checkCurrentUserId(false /* debug */)) {
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

@@ -85,7 +85,7 @@ public class PipManager implements BasePipManager {

        @Override
        public void onActivityUnpinned() {
            if (!checkCurrentUserId(false /* debug */)) {
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

@@ -114,7 +114,7 @@ public class PipManager implements BasePipManager {

        @Override
        public void onPinnedActivityRestartAttempt(boolean clearedTask) {
            if (!checkCurrentUserId(false /* debug */)) {
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

+4 −4
Original line number Diff line number Diff line
@@ -577,7 +577,7 @@ public class PipManager implements BasePipManager {
        @Override
        public void onTaskStackChanged() {
            if (DEBUG) Log.d(TAG, "onTaskStackChanged()");
            if (!checkCurrentUserId(DEBUG)) {
            if (!checkCurrentUserId(mContext, DEBUG)) {
                return;
            }
            if (getState() != STATE_NO_PIP) {
@@ -614,7 +614,7 @@ public class PipManager implements BasePipManager {
        @Override
        public void onActivityPinned(String packageName, int taskId) {
            if (DEBUG) Log.d(TAG, "onActivityPinned()");
            if (!checkCurrentUserId(DEBUG)) {
            if (!checkCurrentUserId(mContext, DEBUG)) {
                return;
            }
            StackInfo stackInfo = getPinnedStackInfo();
@@ -641,7 +641,7 @@ public class PipManager implements BasePipManager {
        @Override
        public void onPinnedActivityRestartAttempt(boolean clearedTask) {
            if (DEBUG) Log.d(TAG, "onPinnedActivityRestartAttempt()");
            if (!checkCurrentUserId(DEBUG)) {
            if (!checkCurrentUserId(mContext, DEBUG)) {
                return;
            }
            // If PIPed activity is launched again by Launcher or intent, make it fullscreen.
@@ -651,7 +651,7 @@ public class PipManager implements BasePipManager {
        @Override
        public void onPinnedStackAnimationEnded() {
            if (DEBUG) Log.d(TAG, "onPinnedStackAnimationEnded()");
            if (!checkCurrentUserId(DEBUG)) {
            if (!checkCurrentUserId(mContext, DEBUG)) {
                return;
            }
            switch (getState()) {
+10 −11
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.systemui.recents;
import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS;

import android.app.ActivityManager;
import android.app.UiModeManager;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -33,7 +32,6 @@ import android.hardware.display.DisplayManager;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.UserHandle;
@@ -41,7 +39,6 @@ import android.provider.Settings;
import android.util.EventLog;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
import android.widget.Toast;

import com.android.internal.logging.MetricsLogger;
@@ -60,11 +57,12 @@ import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
import com.android.systemui.recents.events.component.ShowUserToastEvent;
import com.android.systemui.recents.events.ui.RecentsDrawnEvent;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.model.HighResThumbnailLoader;
import com.android.systemui.recents.model.RecentsTaskLoader;
import com.android.systemui.stackdivider.Divider;
import com.android.systemui.statusbar.CommandQueue;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
@@ -322,16 +320,11 @@ public class Recents extends SystemUI
        }
    }

    @Override
    public void toggleRecentApps() {
        toggleRecents();
    }

    /**
     * Toggles the Recents activity.
     */
    @Override
    public void toggleRecents() {
    public void toggleRecentApps() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isUserSetup()) {
@@ -368,7 +361,7 @@ public class Recents extends SystemUI
     * Preloads info for the Recents activity.
     */
    @Override
    public void preloadRecents() {
    public void preloadRecentApps() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isUserSetup()) {
@@ -792,4 +785,10 @@ public class Recents extends SystemUI
        }
        return false;
    }

    @Override
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("Recents");
        pw.println("  currentUserId=" + SystemServicesProxy.getInstance(mContext).getCurrentUser());
    }
}
+46 −22
Original line number Diff line number Diff line
@@ -119,6 +119,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener

        @Override
        public void onTaskStackChangedBackground() {
            // Check this is for the right user
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

            // Preloads the next task
            RecentsConfiguration config = Recents.getConfiguration();
            if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) {
@@ -161,6 +166,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener

        @Override
        public void onActivityPinned(String packageName, int taskId) {
            // Check this is for the right user
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

            // This time needs to be fetched the same way the last active time is fetched in
            // {@link TaskRecord#touchActiveTime}
            Recents.getConfiguration().getLaunchState().launchedFromPipApp = true;
@@ -172,12 +182,22 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener

        @Override
        public void onActivityUnpinned() {
            // Check this is for the right user
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

            EventBus.getDefault().send(new ActivityUnpinnedEvent());
            sLastPipTime = -1;
        }

        @Override
        public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) {
            // Check this is for the right user
            if (!checkCurrentUserId(mContext, false /* debug */)) {
                return;
            }

            EventBus.getDefault().send(new TaskSnapshotChangedEvent(taskId, snapshot));
        }
    }
@@ -413,7 +433,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener

    public void preloadRecents() {
        // Preload only the raw task list into a new load plan (which will be consumed by the
        // RecentsActivity) only if there is a task to animate to.
        // RecentsActivity) only if there is a task to animate to.  Post this to ensure that we
        // don't block the touch feedback on the nav bar button which triggers this.
        mHandler.post(() -> {
            SystemServicesProxy ssp = Recents.getSystemServices();
            MutableBoolean isHomeStackVisible = new MutableBoolean(true);
            if (!ssp.isRecentsActivityVisible(isHomeStackVisible)) {
@@ -427,16 +449,18 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
                loader.preloadTasks(sInstanceLoadPlan, runningTask.id, !isHomeStackVisible.value);
                TaskStack stack = sInstanceLoadPlan.getTaskStack();
                if (stack.getTaskCount() > 0) {
                // Only preload the icon (but not the thumbnail since it may not have been taken for
                // the pausing activity)
                    // Only preload the icon (but not the thumbnail since it may not have been taken
                    // for the pausing activity)
                    preloadIcon(runningTask.id);

                // At this point, we don't know anything about the stack state.  So only calculate
                // the dimensions of the thumbnail that we need for the transition into Recents, but
                // do not draw it until we construct the activity options when we start Recents
                    // At this point, we don't know anything about the stack state.  So only
                    // calculate the dimensions of the thumbnail that we need for the transition
                    // into Recents, but do not draw it until we construct the activity options when
                    // we start Recents
                    updateHeaderBarLayout(stack, null /* window rect override*/);
                }
            }
        });
    }

    public void cancelPreloadingRecents() {
Loading