diff options
| author | Charles Chen <charlesccchen@google.com> | 2020-12-04 15:55:31 +0800 |
|---|---|---|
| committer | Charles Chen <charlesccchen@google.com> | 2021-01-21 17:46:57 +0800 |
| commit | 3c3b134e7d42c65146346eedc90e9ea3e7866ba0 (patch) | |
| tree | 05d7a2112b974355ba32922adbfc7c76348d1ce8 /core/java/android/view/WindowManager.java | |
| parent | f74907691092b73de5dadc607300d83f0258950f (diff) | |
Introduce WM#LayoutParams mWindowContextToken
The window context token is passed to the server side by attaching
to the layout params in WM#addView to receive configuration changes.
Bug: 159767464
Bug: 153369119
Test: atest
WindowContextTest#testCreateWindowContextWindowManagerAttachClientToken
Change-Id: I658b09727b42eb9c2fa2cea63f8a312761e0a9aa
Diffstat (limited to 'core/java/android/view/WindowManager.java')
| -rw-r--r-- | core/java/android/view/WindowManager.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 6d88d637dc24..4975f91e81ab 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -93,6 +93,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.ClipData; import android.content.Context; import android.content.pm.ActivityInfo; +import android.content.res.Configuration; import android.graphics.PixelFormat; import android.graphics.Point; import android.graphics.Rect; @@ -2772,6 +2773,16 @@ public interface WindowManager extends ViewManager { public IBinder token = null; /** + * The token of {@link android.app.WindowContext}. It is usually a + * {@link android.app.WindowTokenClient} and is used for updating + * {@link android.content.res.Resources} from {@link Configuration} propagated from the + * server side. + * + * @hide + */ + public IBinder mWindowContextToken = null; + + /** * Name of the package owning this window. */ public String packageName = null; @@ -3445,6 +3456,7 @@ public interface WindowManager extends ViewManager { out.writeFloat(buttonBrightness); out.writeInt(rotationAnimation); out.writeStrongBinder(token); + out.writeStrongBinder(mWindowContextToken); out.writeString(packageName); TextUtils.writeToParcel(mTitle, out, parcelableFlags); out.writeInt(screenOrientation); @@ -3513,6 +3525,7 @@ public interface WindowManager extends ViewManager { buttonBrightness = in.readFloat(); rotationAnimation = in.readInt(); token = in.readStrongBinder(); + mWindowContextToken = in.readStrongBinder(); packageName = in.readString(); mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); screenOrientation = in.readInt(); @@ -3674,6 +3687,11 @@ public interface WindowManager extends ViewManager { // already have one. token = o.token; } + if (mWindowContextToken == null) { + // NOTE: token only copied if the recipient doesn't + // already have one. + mWindowContextToken = o.mWindowContextToken; + } if (packageName == null) { // NOTE: packageName only copied if the recipient doesn't // already have one. |
