@@ -33,6 +33,11 @@ public final class DisplayInfo implements Parcelable {
3333 */
3434 public int layerStack ;
3535
36+ /**
37+ * Display flags.
38+ */
39+ public int flags ;
40+
3641 /**
3742 * The human-readable name of the display.
3843 */
@@ -189,6 +194,7 @@ public int hashCode() {
189194
190195 public void copyFrom (DisplayInfo other ) {
191196 layerStack = other .layerStack ;
197+ flags = other .flags ;
192198 name = other .name ;
193199 appWidth = other .appWidth ;
194200 appHeight = other .appHeight ;
@@ -207,6 +213,7 @@ public void copyFrom(DisplayInfo other) {
207213
208214 public void readFromParcel (Parcel source ) {
209215 layerStack = source .readInt ();
216+ flags = source .readInt ();
210217 name = source .readString ();
211218 appWidth = source .readInt ();
212219 appHeight = source .readInt ();
@@ -226,6 +233,7 @@ public void readFromParcel(Parcel source) {
226233 @ Override
227234 public void writeToParcel (Parcel dest , int flags ) {
228235 dest .writeInt (layerStack );
236+ dest .writeInt (flags );
229237 dest .writeString (name );
230238 dest .writeInt (appWidth );
231239 dest .writeInt (appHeight );
@@ -286,6 +294,17 @@ public String toString() {
286294 + ", rotation " + rotation
287295 + ", density " + logicalDensityDpi
288296 + ", " + physicalXDpi + " x " + physicalYDpi + " dpi"
289- + ", layerStack " + layerStack + "}" ;
297+ + ", layerStack " + layerStack + flagsToString (flags ) + "}" ;
298+ }
299+
300+ private static String flagsToString (int flags ) {
301+ StringBuilder result = new StringBuilder ();
302+ if ((flags & Display .FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT ) != 0 ) {
303+ result .append (", FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT" );
304+ }
305+ if ((flags & Display .FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS ) != 0 ) {
306+ result .append (", FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS" );
307+ }
308+ return result .toString ();
290309 }
291310}
0 commit comments