1fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown/* 2fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * Copyright (C) 2012 The Android Open Source Project 3fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * 4fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * Licensed under the Apache License, Version 2.0 (the "License"); 5fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * you may not use this file except in compliance with the License. 6fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * You may obtain a copy of the License at 7fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * 8fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * http://www.apache.org/licenses/LICENSE-2.0 9fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * 10fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * Unless required by applicable law or agreed to in writing, software 11fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * distributed under the License is distributed on an "AS IS" BASIS, 12fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * See the License for the specific language governing permissions and 14fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * limitations under the License. 15fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown */ 16fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown 17fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brownpackage com.android.server.display; 18fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown 19cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brownimport android.util.DisplayMetrics; 2092130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brownimport android.view.Display; 2127f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brownimport android.view.Surface; 22cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown 234ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brownimport libcore.util.Objects; 244ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown 25fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown/** 26fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * Describes the characteristics of a physical display device. 27fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown */ 284ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brownfinal class DisplayDeviceInfo { 294ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown /** 304ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown * Flag: Indicates that this display device should be considered the default display 314ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown * device of the system. 324ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown */ 33bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown public static final int FLAG_DEFAULT_DISPLAY = 1 << 0; 344ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown 354ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown /** 3627f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * Flag: Indicates that the orientation of this display device is coupled to the 3727f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * rotation of its associated logical display. 3827f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * <p> 3927f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * This flag should be applied to the default display to indicate that the user 4027f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * physically rotates the display when content is presented in a different orientation. 4127f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * The display manager will apply a coordinate transformation assuming that the 4227f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * physical orientation of the display matches the logical orientation of its content. 4327f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * </p><p> 4427f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * The flag should not be set when the display device is mounted in a fixed orientation 4527f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * such as on a desk. The display manager will apply a coordinate transformation 4627f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * such as a scale and translation to letterbox or pillarbox format under the 4727f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * assumption that the physical orientation of the display is invariant. 4827f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * </p> 494ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown */ 5027f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown public static final int FLAG_ROTATES_WITH_CONTENT = 1 << 1; 51c5df37c285221d0fb113f55b9e78b35632241d3fJeff Brown 52c5df37c285221d0fb113f55b9e78b35632241d3fJeff Brown /** 5377aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown * Flag: Indicates that this display device has secure video output, such as HDCP. 54c5df37c285221d0fb113f55b9e78b35632241d3fJeff Brown */ 5577aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown public static final int FLAG_SECURE = 1 << 2; 5677aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown 5777aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown /** 5877aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown * Flag: Indicates that this display device supports compositing 5977aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown * from gralloc protected buffers. 6077aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown */ 6177aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1 << 3; 624ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown 634ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown /** 64d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown * Touch attachment: Display does not receive touch. 65d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown */ 66d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown public static final int TOUCH_NONE = 0; 67d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown 68d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown /** 69d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown * Touch attachment: Touch input is via the internal interface. 70d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown */ 71d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown public static final int TOUCH_INTERNAL = 1; 72d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown 73d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown /** 74d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown * Touch attachment: Touch input is via an external interface, such as USB. 75d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown */ 76d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown public static final int TOUCH_EXTERNAL = 2; 77d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown 78d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown /** 79848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown * Gets the name of the display device, which may be derived from 80848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown * EDID or other sources. The name may be displayed to the user. 81848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown */ 82848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown public String name; 83848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown 84848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown /** 85fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * The width of the display in its natural orientation, in pixels. 86fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * This value is not affected by display rotation. 87fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown */ 88fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public int width; 89fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown 90fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown /** 91fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * The height of the display in its natural orientation, in pixels. 92fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown * This value is not affected by display rotation. 93fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown */ 94fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public int height; 95fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown 96cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown /** 97cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * The refresh rate of the display. 98cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown */ 99fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public float refreshRate; 100cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown 101cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown /** 102cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * The nominal apparent density of the display in DPI used for layout calculations. 103cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * This density is sensitive to the viewing distance. A big TV and a tablet may have 104cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * the same apparent density even though the pixels on the TV are much bigger than 105cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * those on the tablet. 106cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown */ 107908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn public int densityDpi; 108cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown 109cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown /** 110cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * The physical density of the display in DPI in the X direction. 111cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * This density should specify the physical size of each pixel. 112cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown */ 113fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public float xDpi; 114cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown 115cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown /** 116cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * The physical density of the display in DPI in the X direction. 117cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * This density should specify the physical size of each pixel. 118cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown */ 119fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public float yDpi; 120fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown 121cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown /** 122cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown * Display flags. 123cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown */ 124bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown public int flags; 125bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown 126d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown /** 127d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown * The touch attachment, per {@link DisplayViewport#touch}. 128d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown */ 129d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown public int touch; 130d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown 13127f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown /** 13227f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * The additional rotation to apply to all content presented on the display device 13327f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * relative to its physical coordinate system. Default is {@link Surface#ROTATION_0}. 13427f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * <p> 13527f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * This field can be used to compensate for the fact that the display has been 13627f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * physically rotated relative to its natural orientation such as an HDMI monitor 13727f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * that has been mounted sideways to appear to be portrait rather than landscape. 13827f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown * </p> 13927f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown */ 14027f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown public int rotation = Surface.ROTATION_0; 14127f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown 14292130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown /** 14392130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown * Display type. 14492130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown */ 14592130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown public int type; 14692130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown 14792130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown /** 14892130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown * Display address, or null if none. 14992130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown * Interpretation varies by display type. 15092130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown */ 15192130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown public String address; 15292130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown 153cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown public void setAssumedDensityForExternalDisplay(int width, int height) { 154cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown densityDpi = Math.min(width, height) * DisplayMetrics.DENSITY_XHIGH / 1080; 155cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown // Technically, these values should be smaller than the apparent density 156cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown // but we don't know the physical size of the display. 157cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown xDpi = densityDpi; 158cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown yDpi = densityDpi; 159cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown } 160cbad976b2a36a0895ca94510d5208a86f66cf596Jeff Brown 1614ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown @Override 1624ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown public boolean equals(Object o) { 1634ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown return o instanceof DisplayDeviceInfo && equals((DisplayDeviceInfo)o); 1644ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown } 1654ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown 1664ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown public boolean equals(DisplayDeviceInfo other) { 1674ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown return other != null 1684ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && Objects.equal(name, other.name) 1694ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && width == other.width 1704ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && height == other.height 1714ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && refreshRate == other.refreshRate 1724ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && densityDpi == other.densityDpi 1734ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && xDpi == other.xDpi 1744ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown && yDpi == other.yDpi 175d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown && flags == other.flags 17627f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown && touch == other.touch 17792130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown && rotation == other.rotation 17892130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown && type == other.type 17992130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown && Objects.equal(address, other.address); 1804ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown } 1814ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown 1824ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown @Override 1834ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown public int hashCode() { 1844ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown return 0; // don't care 1854ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown } 1864ed8fe75e1dde1a2b9576f3862aecc5a572c56b5Jeff Brown 187fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public void copyFrom(DisplayDeviceInfo other) { 188848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown name = other.name; 189fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown width = other.width; 190fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown height = other.height; 191fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown refreshRate = other.refreshRate; 192908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn densityDpi = other.densityDpi; 193fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown xDpi = other.xDpi; 194fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown yDpi = other.yDpi; 195bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown flags = other.flags; 196d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown touch = other.touch; 19727f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown rotation = other.rotation; 19892130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown type = other.type; 19992130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown address = other.address; 200fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown } 201fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown 202848c2dc93b6795e171f3dd6f64ea0be65e2762caJeff Brown // For debugging purposes 203fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown @Override 204fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown public String toString() { 20527f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown return "DisplayDeviceInfo{\"" + name + "\": " + width + " x " + height + ", " 20627f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown + refreshRate + " fps, " 207bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown + "density " + densityDpi + ", " + xDpi + " x " + yDpi + " dpi" 20827f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown + ", touch " + touchToString(touch) + flagsToString(flags) 20927f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown + ", rotation " + rotation 21092130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown + ", type " + Display.typeToString(type) 21192130f6407dc51c58b3b941d28a6daf4e04b8d62Jeff Brown + ", address " + address 21227f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown + "}"; 213d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown } 214d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown 215d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown private static String touchToString(int touch) { 216d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown switch (touch) { 217d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown case TOUCH_NONE: 218d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown return "NONE"; 219d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown case TOUCH_INTERNAL: 220d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown return "INTERNAL"; 221d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown case TOUCH_EXTERNAL: 222d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown return "EXTERNAL"; 223d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown default: 224d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown return Integer.toString(touch); 225d728bf514f257670fcb9aa22c6eaf97626072c93Jeff Brown } 226bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown } 227bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown 228bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown private static String flagsToString(int flags) { 229bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown StringBuilder msg = new StringBuilder(); 230bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown if ((flags & FLAG_DEFAULT_DISPLAY) != 0) { 231bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown msg.append(", FLAG_DEFAULT_DISPLAY"); 232bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown } 23327f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown if ((flags & FLAG_ROTATES_WITH_CONTENT) != 0) { 23427f1d674bf9fb53af7facdcb746912e036d5bf75Jeff Brown msg.append(", FLAG_ROTATES_WITH_CONTENT"); 235c5df37c285221d0fb113f55b9e78b35632241d3fJeff Brown } 23677aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown if ((flags & FLAG_SECURE) != 0) { 23777aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown msg.append(", FLAG_SECURE"); 23877aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown } 23977aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown if ((flags & FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0) { 24077aebfdbae489c3712ae3f9bca29d01fb1f09dc2Jeff Brown msg.append(", FLAG_SUPPORTS_PROTECTED_BUFFERS"); 241bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown } 242bd6e1500aedc5461e832f69e76341bff0e55fa2bJeff Brown return msg.toString(); 243fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown } 244fa25bf5382467b1018bd9af7f1cb30a23d7d59f7Jeff Brown} 245