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

Commit 3cd3a993 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by android-build-merger
Browse files

Merge "Fixed exceptions during test tearDown" into oc-dev am: 879450ab

am: 1a3367a4

Change-Id: Ie66136a1782f2e7ba18b33f70672552a3239f0d6
parents 51829ae7 1a3367a4
Loading
Loading
Loading
Loading
+9 −5
Original line number Original line Diff line number Diff line
@@ -158,18 +158,22 @@ class PinnedStackController {
    /**
    /**
     * Reloads all the resources for the current configuration.
     * Reloads all the resources for the current configuration.
     */
     */
    void reloadResources() {
    private void reloadResources() {
        final Resources res = mService.mContext.getResources();
        final Resources res = mService.mContext.getResources();
        mMinSize = res.getDimensionPixelSize(
        mMinSize = res.getDimensionPixelSize(
                com.android.internal.R.dimen.default_minimal_size_pip_resizable_task);
                com.android.internal.R.dimen.default_minimal_size_pip_resizable_task);
        mDefaultAspectRatio = res.getFloat(
        mDefaultAspectRatio = res.getFloat(
                com.android.internal.R.dimen.config_pictureInPictureDefaultAspectRatio);
                com.android.internal.R.dimen.config_pictureInPictureDefaultAspectRatio);
        final Size screenEdgeInsetsDp = Size.parseSize(res.getString(
        final String screenEdgeInsetsDpString = res.getString(
                com.android.internal.R.string.config_defaultPictureInPictureScreenEdgeInsets));
                com.android.internal.R.string.config_defaultPictureInPictureScreenEdgeInsets);
        final Size screenEdgeInsetsDp = !screenEdgeInsetsDpString.isEmpty()
                ? Size.parseSize(screenEdgeInsetsDpString)
                : null;
        mDefaultStackGravity = res.getInteger(
        mDefaultStackGravity = res.getInteger(
                com.android.internal.R.integer.config_defaultPictureInPictureGravity);
                com.android.internal.R.integer.config_defaultPictureInPictureGravity);
        mDisplayContent.getDisplay().getRealMetrics(mTmpMetrics);
        mDisplayContent.getDisplay().getRealMetrics(mTmpMetrics);
        mScreenEdgeInsets = new Point(dpToPx(screenEdgeInsetsDp.getWidth(), mTmpMetrics),
        mScreenEdgeInsets = screenEdgeInsetsDp == null ? new Point()
                : new Point(dpToPx(screenEdgeInsetsDp.getWidth(), mTmpMetrics),
                        dpToPx(screenEdgeInsetsDp.getHeight(), mTmpMetrics));
                        dpToPx(screenEdgeInsetsDp.getHeight(), mTmpMetrics));
        mMinAspectRatio = res.getFloat(
        mMinAspectRatio = res.getFloat(
                com.android.internal.R.dimen.config_pictureInPictureMinAspectRatio);
                com.android.internal.R.dimen.config_pictureInPictureMinAspectRatio);
+4 −0
Original line number Original line Diff line number Diff line
@@ -1310,6 +1310,10 @@ class WindowStateAnimator {
    }
    }


    void setSurfaceBoundariesLocked(final boolean recoveringMemory) {
    void setSurfaceBoundariesLocked(final boolean recoveringMemory) {
        if (mSurfaceController == null) {
            return;
        }

        final WindowState w = mWin;
        final WindowState w = mWin;
        final LayoutParams attrs = mWin.getAttrs();
        final LayoutParams attrs = mWin.getAttrs();
        final Task task = w.getTask();
        final Task task = w.getTask();
+12 −9
Original line number Original line Diff line number Diff line
@@ -120,6 +120,8 @@ class WindowTestsBase {
    @After
    @After
    public void tearDown() throws Exception {
    public void tearDown() throws Exception {
        final LinkedList<WindowState> nonCommonWindows = new LinkedList();
        final LinkedList<WindowState> nonCommonWindows = new LinkedList();

        synchronized (sWm.mWindowMap) {
            sWm.mRoot.forAllWindows(w -> {
            sWm.mRoot.forAllWindows(w -> {
                if (!mCommonWindows.contains(w)) {
                if (!mCommonWindows.contains(w)) {
                    nonCommonWindows.addLast(w);
                    nonCommonWindows.addLast(w);
@@ -133,6 +135,7 @@ class WindowTestsBase {
            mDisplayContent.removeImmediately();
            mDisplayContent.removeImmediately();
            sWm.mInputMethodTarget = null;
            sWm.mInputMethodTarget = null;
        }
        }
    }


    private WindowState createCommonWindow(WindowState parent, int type, String name) {
    private WindowState createCommonWindow(WindowState parent, int type, String name) {
        final WindowState win = createWindow(parent, type, name);
        final WindowState win = createWindow(parent, type, name);