summaryrefslogtreecommitdiff
path: root/core/java/android/view/InsetsController.java
diff options
context:
space:
mode:
authorTiger Huang <tigerhuang@google.com>2020-10-16 04:03:58 +0800
committerTiger Huang <tigerhuang@google.com>2020-10-21 20:20:21 +0800
commit2bf8c796c559c35cf8b3af4da8f54b31cc5d620a (patch)
treee46a1a5063072448e4af0a92711d18cc0f0dd5ae /core/java/android/view/InsetsController.java
parent83348e3862831cf9ca02fe707480081c65c384b1 (diff)
Don't dispatch legacy insets to client
The server won't dispatch the legacy content insets, stable insets, and visible insets to the client. The insets would be computed from the insets state by the client. This CL also fixes the insets scaling issue in compatible mode. Bug: 149813814 Fix: 169940916 Fix: 165412978 Test: atest WindowAddRemovePerfTest InsetsAnimationControlImplTest ActivityRecordTests DisplayPolicyLayoutTests InsetsPolicyTest InsetsStateControllerTest Change-Id: I83570973f587a6abf887752494f750b46e3e484d
Diffstat (limited to 'core/java/android/view/InsetsController.java')
-rw-r--r--core/java/android/view/InsetsController.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index 5037d9e5bfe8..b5bf08443a6c 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -33,6 +33,7 @@ import android.animation.ValueAnimator;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.content.res.CompatibilityInfo;
import android.graphics.Insets;
import android.graphics.Rect;
import android.os.CancellationSignal;
@@ -176,6 +177,14 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
*/
@Nullable
IBinder getWindowToken();
+
+ /**
+ * @return Translator associated with the host, if it has one.
+ */
+ @Nullable
+ default CompatibilityInfo.Translator getTranslator() {
+ return null;
+ }
}
private static final String TAG = "InsetsController";
@@ -994,10 +1003,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
final InsetsAnimationControlRunner runner = useInsetsAnimationThread
? new InsetsAnimationThreadControlRunner(controls,
frame, mState, listener, typesReady, this, durationMs, interpolator,
- animationType, mHost.getHandler())
+ animationType, mHost.getTranslator(), mHost.getHandler())
: new InsetsAnimationControlImpl(controls,
frame, mState, listener, typesReady, this, durationMs, interpolator,
- animationType);
+ animationType, mHost.getTranslator());
mRunningAnimations.add(new RunningAnimation(runner, animationType));
if (DEBUG) Log.d(TAG, "Animation added to runner. useInsetsAnimationThread: "
+ useInsetsAnimationThread);