Loading core/java/android/view/InsetsAnimationThreadControlRunner.java +9 −10 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.SyncRtSurfaceTransactionApplier.applyParams; import android.annotation.UiThread; import android.graphics.Rect; import android.os.Handler; import android.os.Trace; import android.util.SparseArray; import android.view.InsetsController.AnimationType; import android.view.SyncRtSurfaceTransactionApplier.SurfaceParams; Loading Loading @@ -60,6 +61,9 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro @Override public void notifyFinished(InsetsAnimationControlRunner runner, boolean shown) { Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, "InsetsAsyncAnimation: " + WindowInsets.Type.toString(runner.getTypes()), runner.getTypes()); releaseControls(mControl.getControls()); mMainThreadHandler.post(() -> mOuterCallbacks.notifyFinished(InsetsAnimationThreadControlRunner.this, shown)); Loading Loading @@ -93,7 +97,11 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro mOuterCallbacks = controller; mControl = new InsetsAnimationControlImpl(controls, frame, state, listener, types, mCallbacks, durationMs, interpolator, animationType); InsetsAnimationThread.getHandler().post(() -> listener.onReady(mControl, types)); InsetsAnimationThread.getHandler().post(() -> { Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "InsetsAsyncAnimation: " + WindowInsets.Type.toString(types), types); listener.onReady(mControl, types); }); } private void releaseControls(SparseArray<InsetsSourceControl> controls) { Loading @@ -102,15 +110,6 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro } } private SparseArray<InsetsSourceControl> copyControls( SparseArray<InsetsSourceControl> controls) { SparseArray<InsetsSourceControl> copy = new SparseArray<>(controls.size()); for (int i = 0; i < controls.size(); i++) { copy.append(controls.keyAt(i), new InsetsSourceControl(controls.valueAt(i))); } return copy; } @Override @UiThread public int getTypes() { Loading core/java/android/view/InsetsController.java +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.graphics.Insets; import android.graphics.Rect; import android.os.CancellationSignal; import android.os.Handler; import android.os.Trace; import android.util.ArraySet; import android.util.Pair; import android.util.SparseArray; Loading Loading @@ -1139,6 +1140,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (controller.isCancelled()) { return; } Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "InsetsAnimation: " + WindowInsets.Type.toString(types), types); for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { RunningAnimation runningAnimation = mRunningAnimations.get(i); if (runningAnimation.runner == controller) { Loading @@ -1155,6 +1158,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting public void dispatchAnimationEnd(WindowInsetsAnimation animation) { Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, "InsetsAnimation: " + WindowInsets.Type.toString(animation.getTypeMask()), animation.getTypeMask()); mHost.dispatchWindowInsetsAnimationEnd(animation); } Loading core/java/android/view/WindowInsets.java +29 −23 Original line number Diff line number Diff line Loading @@ -1328,30 +1328,36 @@ public final class WindowInsets { } } static String toString(@InsetsType int type) { switch (type) { case STATUS_BARS: return "statusBars"; case NAVIGATION_BARS: return "navigationBars"; case CAPTION_BAR: return "captionBar"; case IME: return "ime"; case SYSTEM_GESTURES: return "systemGestures"; case MANDATORY_SYSTEM_GESTURES: return "mandatorySystemGestures"; case TAPPABLE_ELEMENT: return "tappableElement"; case DISPLAY_CUTOUT: return "displayCutout"; case WINDOW_DECOR: return "windowDecor"; default: throw new IllegalArgumentException("type needs to be >= FIRST and <= LAST," + " type=" + type); static String toString(@InsetsType int types) { StringBuilder result = new StringBuilder(); if ((types & STATUS_BARS) != 0) { result.append("statusBars |"); } if ((types & NAVIGATION_BARS) != 0) { result.append("navigationBars |"); } if ((types & IME) != 0) { result.append("ime |"); } if ((types & SYSTEM_GESTURES) != 0) { result.append("systemGestures |"); } if ((types & MANDATORY_SYSTEM_GESTURES) != 0) { result.append("mandatorySystemGestures |"); } if ((types & TAPPABLE_ELEMENT) != 0) { result.append("tappableElement |"); } if ((types & DISPLAY_CUTOUT) != 0) { result.append("displayCutout |"); } if ((types & WINDOW_DECOR) != 0) { result.append("windowDecor |"); } if (result.length() > 0) { result.delete(result.length() - 2, result.length()); } return result.toString(); } private Type() { Loading Loading
core/java/android/view/InsetsAnimationThreadControlRunner.java +9 −10 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.SyncRtSurfaceTransactionApplier.applyParams; import android.annotation.UiThread; import android.graphics.Rect; import android.os.Handler; import android.os.Trace; import android.util.SparseArray; import android.view.InsetsController.AnimationType; import android.view.SyncRtSurfaceTransactionApplier.SurfaceParams; Loading Loading @@ -60,6 +61,9 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro @Override public void notifyFinished(InsetsAnimationControlRunner runner, boolean shown) { Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, "InsetsAsyncAnimation: " + WindowInsets.Type.toString(runner.getTypes()), runner.getTypes()); releaseControls(mControl.getControls()); mMainThreadHandler.post(() -> mOuterCallbacks.notifyFinished(InsetsAnimationThreadControlRunner.this, shown)); Loading Loading @@ -93,7 +97,11 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro mOuterCallbacks = controller; mControl = new InsetsAnimationControlImpl(controls, frame, state, listener, types, mCallbacks, durationMs, interpolator, animationType); InsetsAnimationThread.getHandler().post(() -> listener.onReady(mControl, types)); InsetsAnimationThread.getHandler().post(() -> { Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "InsetsAsyncAnimation: " + WindowInsets.Type.toString(types), types); listener.onReady(mControl, types); }); } private void releaseControls(SparseArray<InsetsSourceControl> controls) { Loading @@ -102,15 +110,6 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro } } private SparseArray<InsetsSourceControl> copyControls( SparseArray<InsetsSourceControl> controls) { SparseArray<InsetsSourceControl> copy = new SparseArray<>(controls.size()); for (int i = 0; i < controls.size(); i++) { copy.append(controls.keyAt(i), new InsetsSourceControl(controls.valueAt(i))); } return copy; } @Override @UiThread public int getTypes() { Loading
core/java/android/view/InsetsController.java +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.graphics.Insets; import android.graphics.Rect; import android.os.CancellationSignal; import android.os.Handler; import android.os.Trace; import android.util.ArraySet; import android.util.Pair; import android.util.SparseArray; Loading Loading @@ -1139,6 +1140,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (controller.isCancelled()) { return; } Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "InsetsAnimation: " + WindowInsets.Type.toString(types), types); for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { RunningAnimation runningAnimation = mRunningAnimations.get(i); if (runningAnimation.runner == controller) { Loading @@ -1155,6 +1158,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting public void dispatchAnimationEnd(WindowInsetsAnimation animation) { Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, "InsetsAnimation: " + WindowInsets.Type.toString(animation.getTypeMask()), animation.getTypeMask()); mHost.dispatchWindowInsetsAnimationEnd(animation); } Loading
core/java/android/view/WindowInsets.java +29 −23 Original line number Diff line number Diff line Loading @@ -1328,30 +1328,36 @@ public final class WindowInsets { } } static String toString(@InsetsType int type) { switch (type) { case STATUS_BARS: return "statusBars"; case NAVIGATION_BARS: return "navigationBars"; case CAPTION_BAR: return "captionBar"; case IME: return "ime"; case SYSTEM_GESTURES: return "systemGestures"; case MANDATORY_SYSTEM_GESTURES: return "mandatorySystemGestures"; case TAPPABLE_ELEMENT: return "tappableElement"; case DISPLAY_CUTOUT: return "displayCutout"; case WINDOW_DECOR: return "windowDecor"; default: throw new IllegalArgumentException("type needs to be >= FIRST and <= LAST," + " type=" + type); static String toString(@InsetsType int types) { StringBuilder result = new StringBuilder(); if ((types & STATUS_BARS) != 0) { result.append("statusBars |"); } if ((types & NAVIGATION_BARS) != 0) { result.append("navigationBars |"); } if ((types & IME) != 0) { result.append("ime |"); } if ((types & SYSTEM_GESTURES) != 0) { result.append("systemGestures |"); } if ((types & MANDATORY_SYSTEM_GESTURES) != 0) { result.append("mandatorySystemGestures |"); } if ((types & TAPPABLE_ELEMENT) != 0) { result.append("tappableElement |"); } if ((types & DISPLAY_CUTOUT) != 0) { result.append("displayCutout |"); } if ((types & WINDOW_DECOR) != 0) { result.append("windowDecor |"); } if (result.length() > 0) { result.delete(result.length() - 2, result.length()); } return result.toString(); } private Type() { Loading