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

Commit 5a21494d authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'flaky-test' into nyc-dev

* changes:
  Fixed issue with losing window name when copying WindowManager.LayoutParams
  Added AM API to remove a stack
  Don't resume activity on start if there are activities pausing.
parents e542c490 b6e2eadd
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ public class Am extends BaseCommand {
                "       am stack positiontask <TASK_ID> <STACK_ID> <POSITION>\n" +
                "       am stack list\n" +
                "       am stack info <STACK_ID>\n" +
                "       am stack remove <STACK_ID>\n" +
                "       am task lock <TASK_ID>\n" +
                "       am task lock stop\n" +
                "       am task resizeable <TASK_ID> [0 (unresizeable) | 1 (crop_windows) | 2 (resizeable) | 3 (resizeable_and_pipable)]\n" +
@@ -324,6 +325,8 @@ public class Am extends BaseCommand {
                "\n" +
                "am stack info: display the information about activity stack <STACK_ID>.\n" +
                "\n" +
                "am stack remove: remove stack <STACK_ID>.\n" +
                "\n" +
                "am task lock: bring <TASK_ID> to the front and don't allow other tasks to run.\n" +
                "\n" +
                "am task lock stop: end the current task lock.\n" +
@@ -1732,6 +1735,9 @@ public class Am extends BaseCommand {
            case "size-docked-stack-test":
                runStackSizeDockedStackTest();
                break;
            case "remove":
                runStackRemove();
                break;
            default:
                showError("Error: unknown command '" + op + "'");
                break;
@@ -1868,6 +1874,12 @@ public class Am extends BaseCommand {
        }
    }

    private void runStackRemove() throws Exception {
        String stackIdStr = nextArgRequired();
        int stackId = Integer.valueOf(stackIdStr);
        mAm.removeStack(stackId);
    }

    private void runMoveTopActivityToPinnedStack() throws Exception {
        int stackId = Integer.valueOf(nextArgRequired());
        final Rect bounds = getBounds();
+19 −0
Original line number Diff line number Diff line
@@ -2887,6 +2887,13 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            reply.writeNoException();
            return true;
        }
        case REMOVE_STACK: {
            data.enforceInterface(IActivityManager.descriptor);
            final int stackId = data.readInt();
            removeStack(stackId);
            reply.writeNoException();
            return true;
        }
        }

        return super.onTransact(code, data, reply, flags);
@@ -6747,5 +6754,17 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
    };

    @Override
    public void removeStack(int stackId) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeInt(stackId);
        mRemote.transact(REMOVE_STACK, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    private IBinder mRemote;
}
+3 −0
Original line number Diff line number Diff line
@@ -599,6 +599,8 @@ public interface IActivityManager extends IInterface {

    public void notifyPinnedStackAnimationEnded() throws RemoteException;

    public void removeStack(int stackId) throws RemoteException;

    /*
     * Private non-Binder interfaces
     */
@@ -975,4 +977,5 @@ public interface IActivityManager extends IInterface {
    int STOP_LOCAL_VOICE_INTERACTION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 364;
    int SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 365;
    int NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 366;
    int REMOVE_STACK = IBinder.FIRST_CALL_TRANSACTION + 367;
}
+4 −3
Original line number Diff line number Diff line
@@ -1724,7 +1724,7 @@ public interface WindowManager extends ViewManager {
        }

        public final CharSequence getTitle() {
            return mTitle;
            return mTitle != null ? mTitle : "";
        }

        /** @hide */
@@ -1950,7 +1950,8 @@ public interface WindowManager extends ViewManager {
                // already have one.
                packageName = o.packageName;
            }
            if (!mTitle.equals(o.mTitle)) {
            if (o.mTitle != null) {
                // NOTE: mTitle only copied if the originator set one.
                mTitle = o.mTitle;
                changes |= TITLE_CHANGED;
            }
@@ -2194,7 +2195,7 @@ public interface WindowManager extends ViewManager {
            }
        }

        private CharSequence mTitle = "";
        private CharSequence mTitle = null;

        /** @hide */
        @Override
+2 −14
Original line number Diff line number Diff line
@@ -205,22 +205,10 @@ public class PipManager {
    public void closePip() {
        mState = STATE_NO_PIP;
        mPipTaskId = TASK_ID_NO_PIP;
        StackInfo stackInfo = null;
        try {
            stackInfo = mActivityManager.getStackInfo(PINNED_STACK_ID);
            if (stackInfo == null) {
                return;
            }
            mActivityManager.removeStack(PINNED_STACK_ID);
        } catch (RemoteException e) {
            Log.e(TAG, "getStackInfo failed", e);
            return;
        }
        for (int taskId : stackInfo.taskIds) {
            try {
                mActivityManager.removeTask(taskId);
            } catch (RemoteException e) {
                Log.e(TAG, "removeTask failed", e);
            }
            Log.e(TAG, "removeStack failed", e);
        }
    }

Loading