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

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

Merge "Removing check for launched-from package to expand PiP."

parents 8aa30c04 d95687c3
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -31,11 +31,8 @@ oneway interface ITaskStackListener {
     * Called whenever IActivityManager.startActivity is called on an activity that is already
     * running in the pinned stack and the activity is not actually started, but the task is either
     * brought to the front or a new Intent is delivered to it.
     *
     * @param launchedFromPackage the package name of the activity that initiated the restart
     *                            attempt
     */
    void onPinnedActivityRestartAttempt(String launchedFromPackage);
    void onPinnedActivityRestartAttempt();

    /**
     * Called whenever the pinned stack is starting animating a resize.
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub {
    }

    @Override
    public void onPinnedActivityRestartAttempt(String launchedFromPackage) throws RemoteException {
    public void onPinnedActivityRestartAttempt() throws RemoteException {
    }

    @Override
+2 −17
Original line number Diff line number Diff line
@@ -83,27 +83,12 @@ public class PipManager implements BasePipManager {
        }

        @Override
        public void onPinnedActivityRestartAttempt(String launchedFromPackage) {
        public void onPinnedActivityRestartAttempt() {
            if (!checkCurrentUserId(false /* debug */)) {
                return;
            }

            // Expand the activity back to fullscreen only if it was attempted to be restarted from
            // another package than the top activity in the stack
            boolean expandPipToFullscreen = true;
            if (launchedFromPackage != null) {
                ComponentName topActivity = PipUtils.getTopPinnedActivity(mContext,
                        mActivityManager);
                if (topActivity != null
                        && topActivity.getPackageName().equals(launchedFromPackage)) {
                    expandPipToFullscreen = false;
                }
            }
            if (expandPipToFullscreen) {
            mTouchHandler.getMotionHelper().expandPip();
            } else {
                Log.w(TAG, "Can not expand PiP to fullscreen via intent from the same package.");
            }
        }
    };

+1 −1
Original line number Diff line number Diff line
@@ -704,7 +704,7 @@ public class PipManager implements BasePipManager {
        }

        @Override
        public void onPinnedActivityRestartAttempt(String launchedFromPackage) {
        public void onPinnedActivityRestartAttempt() {
            if (DEBUG) Log.d(TAG, "onPinnedActivityRestartAttempt()");
            if (!checkCurrentUserId(DEBUG)) {
                return;
+4 −4
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ public class SystemServicesProxy {
        public void onTaskStackChanged() { }
        public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) { }
        public void onActivityPinned() { }
        public void onPinnedActivityRestartAttempt(String launchedFromPackage) { }
        public void onPinnedActivityRestartAttempt() { }
        public void onPinnedStackAnimationStarted() { }
        public void onPinnedStackAnimationEnded() { }
        public void onActivityForcedResizable(String packageName, int taskId) { }
@@ -199,10 +199,10 @@ public class SystemServicesProxy {
        }

        @Override
        public void onPinnedActivityRestartAttempt(String launchedFromPackage)
        public void onPinnedActivityRestartAttempt()
                throws RemoteException{
            mHandler.removeMessages(H.ON_PINNED_ACTIVITY_RESTART_ATTEMPT);
            mHandler.obtainMessage(H.ON_PINNED_ACTIVITY_RESTART_ATTEMPT, launchedFromPackage)
            mHandler.obtainMessage(H.ON_PINNED_ACTIVITY_RESTART_ATTEMPT)
                    .sendToTarget();
        }

@@ -1252,7 +1252,7 @@ public class SystemServicesProxy {
                }
                case ON_PINNED_ACTIVITY_RESTART_ATTEMPT: {
                    for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) {
                        mTaskStackListeners.get(i).onPinnedActivityRestartAttempt((String) msg.obj);
                        mTaskStackListeners.get(i).onPinnedActivityRestartAttempt();
                    }
                    break;
                }
Loading