Loading services/core/java/com/android/server/wm/PinnedStackController.java +9 −5 Original line number Original line Diff line number Diff line Loading @@ -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); Loading services/core/java/com/android/server/wm/WindowStateAnimator.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java +12 −9 Original line number Original line Diff line number Diff line Loading @@ -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); Loading @@ -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); Loading Loading
services/core/java/com/android/server/wm/PinnedStackController.java +9 −5 Original line number Original line Diff line number Diff line Loading @@ -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); Loading
services/core/java/com/android/server/wm/WindowStateAnimator.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading
services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java +12 −9 Original line number Original line Diff line number Diff line Loading @@ -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); Loading @@ -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); Loading