Loading core/java/android/view/IWindowSession.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -372,4 +372,14 @@ interface IWindowSession { */ oneway void notifyImeWindowVisibilityChangedFromClient(IWindow window, boolean visible, in ImeTracker.Token statsToken); /** * Notifies WindowState whether inset animations are currently running within the Window. * This value is used by the server to vote for refresh rate. * see {@link com.android.server.wm.WindowState#mInsetsAnimationRunning). * * @param window The window that is insets animaiton is running. * @param running Indicates the insets animation state. */ oneway void notifyInsetsAnimationRunningStateChanged(IWindow window, boolean running); } core/java/android/view/ViewRootImpl.java +5 −1 Original line number Diff line number Diff line Loading @@ -2514,12 +2514,16 @@ public final class ViewRootImpl implements ViewParent, @VisibleForTesting public void notifyInsetsAnimationRunningStateChanged(boolean running) { if (sToolkitSetFrameRateReadOnlyFlagValue) { mInsetsAnimationRunning = running; if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.instant(Trace.TRACE_TAG_VIEW, TextUtils.formatSimple("notifyInsetsAnimationRunningStateChanged(%s)", Boolean.toString(running))); } mInsetsAnimationRunning = running; try { mWindowSession.notifyInsetsAnimationRunningStateChanged(mWindow, running); } catch (RemoteException e) { } } } Loading core/java/android/view/WindowlessWindowManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,11 @@ public class WindowlessWindowManager implements IWindowSession { @NonNull ImeTracker.Token statsToken) { } @Override public void notifyInsetsAnimationRunningStateChanged(IWindow window, boolean running) { // NO-OP } void setParentInterface(@Nullable ISurfaceControlViewHostParent parentInterface) { IBinder oldInterface = mParentInterface == null ? null : mParentInterface.asBinder(); IBinder newInterface = parentInterface == null ? null : parentInterface.asBinder(); Loading services/core/java/com/android/server/wm/RefreshRatePolicy.java +8 −2 Original line number Diff line number Diff line Loading @@ -234,6 +234,12 @@ class RefreshRatePolicy { return w.mFrameRateVote.reset(); } // If insets animation is running, do not convey the preferred app refresh rate to let VRI // to control the refresh rate. if (w.isInsetsAnimationRunning()) { return w.mFrameRateVote.reset(); } // If the app set a preferredDisplayModeId, the preferred refresh rate is the refresh rate // of that mode id. if (refreshRateSwitchingType != SWITCHING_TYPE_RENDER_FRAME_RATE_ONLY) { Loading Loading @@ -272,7 +278,7 @@ class RefreshRatePolicy { float getPreferredMinRefreshRate(WindowState w) { // If app is animating, it's not able to control refresh rate because we want the animation // to run in default refresh rate. if (w.isAnimationRunningSelfOrParent()) { if (w.isAnimationRunningSelfOrParent() || w.isInsetsAnimationRunning()) { return 0; } Loading @@ -295,7 +301,7 @@ class RefreshRatePolicy { float getPreferredMaxRefreshRate(WindowState w) { // If app is animating, it's not able to control refresh rate because we want the animation // to run in default refresh rate. if (w.isAnimationRunningSelfOrParent()) { if (w.isAnimationRunningSelfOrParent() || w.isInsetsAnimationRunning()) { return 0; } Loading services/core/java/com/android/server/wm/Session.java +11 −0 Original line number Diff line number Diff line Loading @@ -1012,4 +1012,15 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { } } } @Override public void notifyInsetsAnimationRunningStateChanged(IWindow window, boolean running) { synchronized (mService.mGlobalLock) { final WindowState win = mService.windowForClientLocked(this, window, false /* throwOnError */); if (win != null) { win.notifyInsetsAnimationRunningStateChanged(running); } } } } Loading
core/java/android/view/IWindowSession.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -372,4 +372,14 @@ interface IWindowSession { */ oneway void notifyImeWindowVisibilityChangedFromClient(IWindow window, boolean visible, in ImeTracker.Token statsToken); /** * Notifies WindowState whether inset animations are currently running within the Window. * This value is used by the server to vote for refresh rate. * see {@link com.android.server.wm.WindowState#mInsetsAnimationRunning). * * @param window The window that is insets animaiton is running. * @param running Indicates the insets animation state. */ oneway void notifyInsetsAnimationRunningStateChanged(IWindow window, boolean running); }
core/java/android/view/ViewRootImpl.java +5 −1 Original line number Diff line number Diff line Loading @@ -2514,12 +2514,16 @@ public final class ViewRootImpl implements ViewParent, @VisibleForTesting public void notifyInsetsAnimationRunningStateChanged(boolean running) { if (sToolkitSetFrameRateReadOnlyFlagValue) { mInsetsAnimationRunning = running; if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.instant(Trace.TRACE_TAG_VIEW, TextUtils.formatSimple("notifyInsetsAnimationRunningStateChanged(%s)", Boolean.toString(running))); } mInsetsAnimationRunning = running; try { mWindowSession.notifyInsetsAnimationRunningStateChanged(mWindow, running); } catch (RemoteException e) { } } } Loading
core/java/android/view/WindowlessWindowManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,11 @@ public class WindowlessWindowManager implements IWindowSession { @NonNull ImeTracker.Token statsToken) { } @Override public void notifyInsetsAnimationRunningStateChanged(IWindow window, boolean running) { // NO-OP } void setParentInterface(@Nullable ISurfaceControlViewHostParent parentInterface) { IBinder oldInterface = mParentInterface == null ? null : mParentInterface.asBinder(); IBinder newInterface = parentInterface == null ? null : parentInterface.asBinder(); Loading
services/core/java/com/android/server/wm/RefreshRatePolicy.java +8 −2 Original line number Diff line number Diff line Loading @@ -234,6 +234,12 @@ class RefreshRatePolicy { return w.mFrameRateVote.reset(); } // If insets animation is running, do not convey the preferred app refresh rate to let VRI // to control the refresh rate. if (w.isInsetsAnimationRunning()) { return w.mFrameRateVote.reset(); } // If the app set a preferredDisplayModeId, the preferred refresh rate is the refresh rate // of that mode id. if (refreshRateSwitchingType != SWITCHING_TYPE_RENDER_FRAME_RATE_ONLY) { Loading Loading @@ -272,7 +278,7 @@ class RefreshRatePolicy { float getPreferredMinRefreshRate(WindowState w) { // If app is animating, it's not able to control refresh rate because we want the animation // to run in default refresh rate. if (w.isAnimationRunningSelfOrParent()) { if (w.isAnimationRunningSelfOrParent() || w.isInsetsAnimationRunning()) { return 0; } Loading @@ -295,7 +301,7 @@ class RefreshRatePolicy { float getPreferredMaxRefreshRate(WindowState w) { // If app is animating, it's not able to control refresh rate because we want the animation // to run in default refresh rate. if (w.isAnimationRunningSelfOrParent()) { if (w.isAnimationRunningSelfOrParent() || w.isInsetsAnimationRunning()) { return 0; } Loading
services/core/java/com/android/server/wm/Session.java +11 −0 Original line number Diff line number Diff line Loading @@ -1012,4 +1012,15 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { } } } @Override public void notifyInsetsAnimationRunningStateChanged(IWindow window, boolean running) { synchronized (mService.mGlobalLock) { final WindowState win = mService.windowForClientLocked(this, window, false /* throwOnError */); if (win != null) { win.notifyInsetsAnimationRunningStateChanged(running); } } } }