diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-10-24 12:14:07 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-24 12:14:08 -0700 |
| commit | 1202c43685c475158a773d03d70effa01b6bb4ff (patch) | |
| tree | 5bbfcb940bd63f785146444e1241a2e4dd45abfe /services/java | |
| parent | 8e080d7e10dd17662750605538a9799af66494e9 (diff) | |
| parent | f0681b34dffc1510cbd9c3da5c3a7e695553fa8d (diff) | |
| download | frameworks_base-1202c43685c475158a773d03d70effa01b6bb4ff.zip frameworks_base-1202c43685c475158a773d03d70effa01b6bb4ff.tar.gz frameworks_base-1202c43685c475158a773d03d70effa01b6bb4ff.tar.bz2 | |
Merge "Secure windows, secure surface views and secure displays." into jb-mr1-dev
Diffstat (limited to 'services/java')
3 files changed, 14 insertions, 8 deletions
diff --git a/services/java/com/android/server/display/LocalDisplayAdapter.java b/services/java/com/android/server/display/LocalDisplayAdapter.java index d6c5248..fa56b83 100644 --- a/services/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/java/com/android/server/display/LocalDisplayAdapter.java @@ -127,10 +127,12 @@ final class LocalDisplayAdapter extends DisplayAdapter { mInfo.height = mPhys.height; mInfo.refreshRate = mPhys.refreshRate; - // Assume that all built-in displays have secure output (eg. HDCP) and + // Assume that all built-in displays that have secure output (eg. HDCP) also // support compositing from gralloc protected buffers. - mInfo.flags = DisplayDeviceInfo.FLAG_SECURE - | DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS; + if (mPhys.secure) { + mInfo.flags = DisplayDeviceInfo.FLAG_SECURE + | DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS; + } if (mBuiltInDisplayId == Surface.BUILT_IN_DISPLAY_ID_MAIN) { mInfo.name = getContext().getResources().getString( diff --git a/services/java/com/android/server/display/LogicalDisplay.java b/services/java/com/android/server/display/LogicalDisplay.java index aa7ea82..aa62aee 100644 --- a/services/java/com/android/server/display/LogicalDisplay.java +++ b/services/java/com/android/server/display/LogicalDisplay.java @@ -186,6 +186,9 @@ final class LogicalDisplay { if ((deviceInfo.flags & DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0) { mBaseDisplayInfo.flags |= Display.FLAG_SUPPORTS_PROTECTED_BUFFERS; } + if ((deviceInfo.flags & DisplayDeviceInfo.FLAG_SECURE) != 0) { + mBaseDisplayInfo.flags |= Display.FLAG_SECURE; + } mBaseDisplayInfo.name = deviceInfo.name; mBaseDisplayInfo.appWidth = deviceInfo.width; mBaseDisplayInfo.appHeight = deviceInfo.height; diff --git a/services/java/com/android/server/display/WifiDisplayAdapter.java b/services/java/com/android/server/display/WifiDisplayAdapter.java index 97fc3e6..2ea83ee 100644 --- a/services/java/com/android/server/display/WifiDisplayAdapter.java +++ b/services/java/com/android/server/display/WifiDisplayAdapter.java @@ -281,18 +281,19 @@ final class WifiDisplayAdapter extends DisplayAdapter { scheduleStatusChangedBroadcastLocked(); } + boolean secure = (flags & RemoteDisplay.DISPLAY_FLAG_SECURE) != 0; int deviceFlags = 0; - if ((flags & RemoteDisplay.DISPLAY_FLAG_SECURE) != 0) { + if (secure) { deviceFlags |= DisplayDeviceInfo.FLAG_SECURE; - } - if (mSupportsProtectedBuffers) { - deviceFlags |= DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS; + if (mSupportsProtectedBuffers) { + deviceFlags |= DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS; + } } float refreshRate = 60.0f; // TODO: get this for real String name = display.getFriendlyDisplayName(); - IBinder displayToken = Surface.createDisplay(name, false); + IBinder displayToken = Surface.createDisplay(name, secure); mDisplayDevice = new WifiDisplayDevice(displayToken, name, width, height, refreshRate, deviceFlags, surface); sendDisplayDeviceEventLocked(mDisplayDevice, DISPLAY_DEVICE_EVENT_ADDED); |
