summaryrefslogtreecommitdiff
path: root/core/java/android/view/WindowManager.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-02-02 15:55:35 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-02-02 15:55:35 +0000
commitdc22edcddb261a568faa154f537c0607726f061d (patch)
tree05cfe1620be839f7147ace645a1ae839e4c8e569 /core/java/android/view/WindowManager.java
parentd21bde0cef11621a1d2f28e635e12312ae208d26 (diff)
parentbdd07c2982cc8939c6b764ad46f094db2321b2e1 (diff)
Merge "Promote mWindowContextToken to TestApi" into sc-dev
Diffstat (limited to 'core/java/android/view/WindowManager.java')
-rw-r--r--core/java/android/view/WindowManager.java41
1 files changed, 38 insertions, 3 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index fa471fa28c7f..8319b74d9cdf 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -83,6 +83,7 @@ import static android.view.WindowLayoutParamsProto.Y;
import android.Manifest.permission;
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
@@ -99,6 +100,7 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Build;
+import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
@@ -2855,12 +2857,14 @@ public interface WindowManager extends ViewManager {
/**
* 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.
+ * {@link android.app.WindowTokenClient} and is used for associating the params with an
+ * existing node in the WindowManager hierarchy and getting the corresponding
+ * {@link Configuration} and {@link android.content.res.Resources} values with updates
+ * propagated from the server side.
*
* @hide
*/
+ @Nullable
public IBinder mWindowContextToken = null;
/**
@@ -3547,6 +3551,37 @@ public interface WindowManager extends ViewManager {
return userActivityTimeout;
}
+ /**
+ * Sets the {@link android.app.WindowContext} token.
+ *
+ * @see #getWindowContextToken()
+ *
+ * @hide
+ */
+ @TestApi
+ public final void setWindowContextToken(@NonNull IBinder token) {
+ mWindowContextToken = token;
+ }
+
+ /**
+ * Gets the {@link android.app.WindowContext} token.
+ *
+ * The token is usually a {@link android.app.WindowTokenClient} and is used for associating
+ * the params with an existing node in the WindowManager hierarchy and getting the
+ * corresponding {@link Configuration} and {@link android.content.res.Resources} values with
+ * updates propagated from the server side.
+ *
+ * @see android.app.WindowTokenClient
+ * @see Context#createWindowContext(Display, int, Bundle)
+ *
+ * @hide
+ */
+ @TestApi
+ @Nullable
+ public final IBinder getWindowContextToken() {
+ return mWindowContextToken;
+ }
+
public int describeContents() {
return 0;
}