summaryrefslogtreecommitdiff
path: root/core/java/android/app/WindowConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app/WindowConfiguration.java')
-rw-r--r--core/java/android/app/WindowConfiguration.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index e6fb5dc02ce3..096c7aa44446 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -28,9 +28,13 @@ import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
+import android.util.proto.ProtoInputStream;
import android.util.proto.ProtoOutputStream;
+import android.util.proto.WireTypeMismatchException;
import android.view.DisplayInfo;
+import java.io.IOException;
+
/**
* Class that contains windowing configuration/state for other objects that contain windows directly
* or indirectly. E.g. Activities, Task, Displays, ...
@@ -511,6 +515,38 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
}
/**
+ * Read from a protocol buffer input stream.
+ * Protocol buffer message definition at {@link android.app.WindowConfigurationProto}
+ *
+ * @param proto Stream to read the WindowConfiguration object from.
+ * @param fieldId Field Id of the WindowConfiguration as defined in the parent message
+ * @hide
+ */
+ public void readFromProto(ProtoInputStream proto, long fieldId)
+ throws IOException, WireTypeMismatchException {
+ final long token = proto.start(fieldId);
+ try {
+ while (proto.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
+ switch (proto.getFieldNumber()) {
+ case (int) APP_BOUNDS:
+ mAppBounds = new Rect();
+ mAppBounds.readFromProto(proto, APP_BOUNDS);
+ break;
+ case (int) WINDOWING_MODE:
+ mWindowingMode = proto.readInt(WINDOWING_MODE);
+ break;
+ case (int) ACTIVITY_TYPE:
+ mActivityType = proto.readInt(ACTIVITY_TYPE);
+ break;
+ }
+ }
+ } finally {
+ // Let caller handle any exceptions
+ proto.end(token);
+ }
+ }
+
+ /**
* Returns true if the activities associated with this window configuration display a shadow
* around their border.
* @hide