5

Can't find anything definitive on Android Doc and Google.

If there is API to detect this, what is it and what is the API to enable/disable HDCP on the HDMI output?

If there is NO API to detect this, is there a device can be used to check the HDCP flag on HDMI port?

On some android devices (most notably Samsung devices), the HDMI port always has HDCP enabled. But how about other manufactures devices? Is HDCP mandatory on Google certified device? If it's not mandatory, how do major content providers's Android apps (from Big cable company teleco) prevent video output to non-HDCP protected HDMI port?

Yi Wang
  • 552
  • 2
  • 7
  • 20
  • [Here is a related bug report](https://code.google.com/p/android/issues/detail?id=52985) you may find interesting. It should answer at least some of your questions. – MH. Aug 22 '13 at 02:50
  • Thanks MH. That is very interesting indeed. I am more interested in detecting if HDCP is enabled on the HDMI port. Even if there is no way to enable/disable HDCP, as long as the app knows that HDCP isn't available, it can refuse to playback HD content. – Yi Wang Aug 22 '13 at 03:07
  • Note that I can't just check the hardware name and model then assume HDCP is available. This won't work because device name and model can easily be changed on a root devices. – Yi Wang Sep 04 '13 at 20:59

4 Answers4

2

You can try to check the Display flags: http://developer.android.com/reference/android/view/Display.html#getFlags()

FLAG_SECURE or FLAG_SUPPORTS_PROTECTED_BUFFERS (http://developer.android.com/reference/android/view/Display.html#FLAG_SECURE and http://developer.android.com/reference/android/view/Display.html#FLAG_SUPPORTS_PROTECTED_BUFFERS)

Marcos Zolnowski
  • 2,751
  • 1
  • 24
  • 29
  • Thanks looks like's its related to HDCP flag but there is absolutely no examples of how to allocate a secured buffer then use the buffer to output video frames. – Yi Wang Nov 29 '13 at 18:15
  • I believe you would allocate a [SurfaceView](http://developer.android.com/reference/android/view/SurfaceView.html), then call [setSecure](http://developer.android.com/reference/android/view/SurfaceView.html#setSecure(boolean)). After that, using [MediaPlayer](http://developer.android.com/reference/android/media/MediaPlayer.html), call [setDisplay](http://developer.android.com/reference/android/media/MediaPlayer.html#setDisplay(android.view.SurfaceHolder))(exampleSurfaceView.getHolder()). – Marcos Zolnowski Dec 10 '13 at 00:24
  • 1
    Actually, is it possible to have a special android version that returns true for flag FLAG_SECURE and have no HDCP at all? The special android is there just to fool application into thinking that HDCP is available but in fact it's not. – Yi Wang Jan 13 '14 at 22:59
1

This is an older thread - but since I am working on this stuff again I thought I would update.

As of API 17 (Android 4.2+), you can get a decent proxy for HDCP information from the standard Android SDK.

If you want to ensure that a display is "secure" you can call setSecure(true) on the application Surface. Then for good measure you can enumerate the available Displays and verify that FLAG_SECURE is set for each one. This will block DDMS and at least hint to the display driver that the output should have HDCP turned on. No guarantees though and your mileage may vary.

On further note -- the path Alex noted above may have changed on newer devices (Android 5.1+). But since this is dependent on the OEM, expect this may vary on different devices. :-(

Joe Steele
  • 563
  • 5
  • 13
0

Motorola had an API: http://web.archive.org/web/20120213100531/http://developer.motorola.com/docstools/library/motorola-hdmi-status-api/

We do still use it for older devices. I also read that someone was having some success still using this on new devices through adb so if someone knows if this still works on newer Motorola devices please share.

Also I know this isn't what you were asking for however we're using this for HDMI status (/sys/devices/virtual/switch/hdmi/state), hopefully they expand it in the future for HDCP support as well...so you may want to watch that space as well.

amohr
  • 455
  • 3
  • 10
-2

More often than not if it has a HDMI port HDCP is going to be enabled because it wouldn't work without it!

Josh Keighley
  • 215
  • 1
  • 2
  • 7