@@ -82,21 +82,64 @@ public final class Display {
8282 * Display flag: Indicates that the display supports compositing content
8383 * that is stored in protected graphics buffers.
8484 * <p>
85+ * If this flag is set then the display device supports compositing protected buffers.
86+ * </p><p>
87+ * If this flag is not set then the display device may not support compositing
88+ * protected buffers; the user may see a blank region on the screen instead of
89+ * the protected content.
90+ * </p><p>
8591 * Secure (DRM) video decoders may allocate protected graphics buffers to request that
8692 * a hardware-protected path be provided between the video decoder and the external
8793 * display sink. If a hardware-protected path is not available, then content stored
8894 * in protected graphics buffers may not be composited.
8995 * </p><p>
90- * If this flag is not set, then the display device does not support compositing
91- * protected buffers; the user may see a blank region on the screen instead of
92- * the protected content. An application can use this flag as a hint that it should
93- * select an alternate content stream or adopt a different strategy for decoding
94- * content that does not rely on protected buffers so as to ensure that the user
95- * can view the content on the display as expected .
96+ * An application can use the absence of this flag as a hint that it should not use protected
97+ * buffers for this display because the content may not be visible. For example,
98+ * if the flag is not set then the application may choose not to show content on this
99+ * display, show an informative error message, select an alternate content stream
100+ * or adopt a different strategy for decoding content that does not rely on
101+ * protected buffers .
96102 * </p>
103+ *
104+ * @see #getFlags
97105 */
98106 public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1 << 0 ;
99107
108+ /**
109+ * Display flag: Indicates that the display has a secure video output and
110+ * supports compositing secure surfaces.
111+ * <p>
112+ * If this flag is set then the display device has a secure video output
113+ * and is capable of showing secure surfaces. It may also be capable of
114+ * showing {@link #FLAG_SUPPORTS_PROTECTED_BUFFERS protected buffers}.
115+ * </p><p>
116+ * If this flag is not set then the display device may not have a secure video
117+ * output; the user may see a blank region on the screen instead of
118+ * the contents of secure surfaces or protected buffers.
119+ * </p><p>
120+ * Secure surfaces are used to prevent content rendered into those surfaces
121+ * by applications from appearing in screenshots or from being viewed
122+ * on non-secure displays. Protected buffers are used by secure video decoders
123+ * for a similar purpose.
124+ * </p><p>
125+ * An application creates a window with a secure surface by specifying the
126+ * {@link WindowManager.LayoutParams#FLAG_SECURE} window flag.
127+ * Likewise, an application creates a {@link SurfaceView} with a secure surface
128+ * by calling {@link SurfaceView#setSecure} before attaching the secure view to
129+ * its containing window.
130+ * </p><p>
131+ * An application can use the absence of this flag as a hint that it should not create
132+ * secure surfaces or protected buffers on this display because the content may
133+ * not be visible. For example, if the flag is not set then the application may
134+ * choose not to show content on this display, show an informative error message,
135+ * select an alternate content stream or adopt a different strategy for decoding
136+ * content that does not rely on secure surfaces or protected buffers.
137+ * </p>
138+ *
139+ * @see #getFlags
140+ */
141+ public static final int FLAG_SECURE = 1 << 1 ;
142+
100143 /**
101144 * Internal method to create a display.
102145 * Applications should use {@link android.view.WindowManager#getDefaultDisplay()}
@@ -182,6 +225,7 @@ public int getLayerStack() {
182225 * @return The display flags.
183226 *
184227 * @see #FLAG_SUPPORTS_PROTECTED_BUFFERS
228+ * @see #FLAG_SECURE
185229 */
186230 public int getFlags () {
187231 synchronized (this ) {
0 commit comments