Commit Graph

27 Commits

Author SHA1 Message Date
Edwin Wong
53e8348860 Add lshal debug hook.
[Merge of http://go/wvgerrit/101804]

Dump build info and Widevine DRM service properties.

Test: adb shell lshal debug [drm service]
  adb shell lshal debug android.hardware.drm@1.3::IDrmFactory/widevine

Bug: 154027349
Change-Id: Ide918d7bab7a59c1564ccec57cbfef1fff9e5f0b
2020-06-15 12:09:24 -07:00
Robert Shih
8fce3e316b wv hidl: upgrade Drm/Crypto factories to v1.3
Bug: 139134043
Test: MediaDrmTest
Change-Id: I94d1cc8a323c144805d74d5568944dd48ae80e60
2019-12-16 01:19:49 -08:00
Robert Shih
84061e93d6 wv hidl factories: cleanup includes & logging
Addresses code review comments from http://go/wvgerrit/89383
* Use WVCdm LOG_TAG
* Cleanup includes

Bug: 134787536
Test: build
Change-Id: I2576127489205de62902d6c290f9293947976094
2019-11-13 02:40:45 +00:00
Robert Shih
e083240191 wv hidl factories: getCallingSid logging
[ Merge of http://go/wvgerrit/89383 ]

Bug: 134787536
Test: check calling sid in logs
Change-Id: If47ccaf9296a157b72181fb2bd00318bb957c15c
2019-11-10 01:59:37 +00:00
Robert Shih
bb093eee1e wv hidl: setRequestingSid to true
HALs need to getCallingSid to verify clients.

[ Merge of http://go/wvgerrit/89123 ]

Bug: 134787536
Test: log calling sid
Change-Id: I9cfbddfc274457a6802d9c8f37470d656771acc6
2019-11-07 12:22:58 -08:00
Robert Shih
70f630ddd1 Add Widevine HIDL service to "system" group
Bug: 138709931
Test: 1) Keep the widevine splitbins ONLY at /vendor/firmware_mnt/image
      2) L1 secure video playback

Change-Id: Icbb749a0ac379015ed48c4bf32f7647d7fbe5b96
2019-09-11 23:45:03 +00:00
Peter Kalauskas
c712a82656 Convert LazyServiceRegistrar usage to singleton
Test: lshal
Bug: 139376253
Change-Id: Id3c5f7d4f66af5bdab99c9ecfce4ceef9cfd5b75
2019-08-19 11:17:21 -07:00
John W. Bruce
edccc13510 Disallow Blank App Package Name on Q and Later
(This is a merge of http://go/wvgerrit/78105)

The Widevine Android CDM should not allow itself to be instantiated
without an app package name, as this breaks SPOID protection.
Unfortunately, pathways exist prior to Android Q that allow this to
happen, and we cannot break these devices by changing the behavior now.
As such, we will only refuse to allow instantiation without an app
package name on devices first launched with Q and later.

This change also migrates the WVDrmFactory and its tests away from
explicitly naming friend classes for individual test, in favor of the
now-recommended "test peer" pattern.

Bug: 65680731
Test: libwvdrmengine_hidl_test
Test: CTS NativeMediaDrmClearkeyTest
Change-Id: Icccd1d8b9972ef6ad7e5b0dbf2d37ec987656385
2019-05-08 01:08:11 +00:00
Peter Kalauskas
afc46da6dc Merge "Add lazy service target to widevine" 2019-01-30 21:54:58 +00:00
Peter Kalauskas
1afc15fba3 Add lazy service target to widevine
Test: Run widevine media GTS tests
Bug: 112386116
Change-Id: Id0a735def8d3bf4e71df1952c3d4d8034f3aabda
2019-01-30 09:26:09 -08:00
Jeff Tinker
8084bd5375 Implement isCryptoSchemeSupported in the Widevine drm plugin
Support overloaded isCryptoSchemeSupported method that
accepts a security level parameter

bug:110701831
test: cts media test cases, widevine integration tests, gts media tests

Change-Id: Ia84e40ff8d4f13fc06478e338e3238061e283dac
2019-01-30 07:10:10 +00:00
Jeff Tinker
bf6245967e Add securityLevel to MediaDrm isCryptoSchemeSupported API
bug:110701831
test: cts media test cases, widevine integration tests

Change-Id: I4a8973537b4b90740cdaf79a36e73943bcf074fb
2019-01-22 23:27:48 +00:00
Rahul Frias
ef00d6ffa5 Update property retrival method
[ Merge of http://go/wvgerrit/70203 ]

The earlier property_get() method had a limitation on property length.
Properties of some new devices exceed that length. An error message
is returned rather than a truncated string. Replace its use with
android::base::GetProperty() which does not have a length limitation.

Bug: 115358798
Test: WV unit/integration tests
Change-Id: I46ce9a7e77bcd031225d0082f83c57d484fe5405
2019-01-15 00:24:52 -08:00
Jeff Tinker
a00b50095c Add additional error conditions to MediaDrm
Merge of http://go/wvgerrit/70163

New codes are being added to handle resource
contention, lost session state, frame size too
large and insufficient security level for
decryption. Also cleans up inconsistent use of
tamper detected error where invalid state error
should have been used.

bug:111504510
bug:111505796
test: cts and gts media tests, widevine integration tests

Change-Id: I96ee441717d32ccbcabaa85c8f6a0013055ce16e
2019-01-10 15:17:48 -08:00
Edwin Wong
20adb9438d Update Widevine HIDL service to 1.2.
Widevine HIDL service added new v1.2 media APIs,
update the service to support new APIs.

Merged from http://go/wvgerrit/67083

Test: Netflix and Play Movies & TV (streaming and offline playback)

Test: GTS WidevineH264PlaybackTests test
  e.g. ANDROID_BUILD_TOP= ./android-gts/toolsefed run gts -m GtsMediaTestCases
  --test com.google.android.media.gts.WidevineH264PlaybackTests#testL1With480P30

Test: Widevine unit tests

bug: 117570686
Change-Id: I3a2091e7c62a0d2697ef97f983fd898aedfb4519
2018-11-30 16:02:07 -08:00
Fred Gylys-Colwell
bbb89c2d7f Fix whitespace and copyrights
There were some mistakes in previous merges from pi-dev to master in
whitespace and copyright notices. This fixes them.

Test: tested as part of http://go/ag/4674759
Change-Id: Iae46c121de59233b62925a4d8c97f2b370e3e7f1
2018-09-09 11:37:48 -07:00
Edwin Wong
bc66aebfe2 Upgrade widevine HIDL service to v1.1.
Merged from http://go/wvgerrit/44803.

Upgrade HIDL service to v1.1 and implements new 1.1 media API.

Test: Netflix and Play Movies & TV
  streaming and offline playback

Test: GTS WidevineH264PlaybackTests test
  e.g. ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases
  --test com.google.android.media.gts.WidevineH264PlaybackTests#testL1With480P30

Test: GTS MediaDrmTest tests
  e.g. ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases
  --test com.google.android.media.gts.MediaDrmTest#testWidevineApi28

Test: unit tests

bug: 69674645
Change-Id: I91e7e43f9178b61a531e846beffb5f5c17050a3c
2018-03-30 14:57:16 -07:00
Edwin Wong
59fcc20138 Move persistent data to /data/vendor.
Widevine persistent data is stored in /data/mediadrm, HALs
are not allowed to access files in /data. Move persistent
data to /data/vendor/mediadrm/widevine for older devices,
and persistent data will not be saved under /data/vendor.

Test: Play Movies & Tv, Netflix

bug: 36601695
Change-Id: I31fdd43b7db327bf6d8343dc95e9883ae6bce70d
2018-01-15 13:50:06 -08:00
Jaekyun Seok
69d93e5d53 Add 'vendor.' prefix to a vendor HAL service name
To prevent property name collisions between properties of system and
vendor, 'vendor.' prefix must be added to a vendor HAL service name.
You can see the details in http://go/treble-sysprop-compatibility.

Test: succeeded building and tested on a walleye device
Bug: 36796459
Change-Id: I6199c7c4f7f978637443f73ec5428805a9ae658c
2017-08-31 13:00:46 +09:00
Edwin Wong
485f11483c Replace toStatus indirection.
CdmResponseType are mapped to android::status_t, then map to hidl
android::hardware::drm::V1_0::Status. This CL removes the indirection
by mapping cdm errors to hidl Status.

Test: Play Movies (pin and streaming)
Test: Netflix (download and streaming)
Test: libwvdrmmediacrypto_hidl_test and libwvdrmdrmplugin_hidl_test
Test: GtsMediaTestCases module
Test: Vts - VtsHalDrmV1_0Target

bug: 34682447
Change-Id: I0b04f47871f5e4898e7297831d5fceab52e0f7f9
2017-08-03 17:57:44 -07:00
John W. Bruce
68d26ef98b Remove API Version TODO Comments
(This is a merge of http://go/wvgerrit/26221)

We have agreed on API 26 for O, so these comments can be removed without
making any further changes.

Bug: 34548395
Test: This is a comment-only change. But I verified it builds.
Change-Id: I490befba4f47902a84b60e562a7a5eb162a9f3be
2017-04-19 16:48:14 -07:00
John W. Bruce
19947dfe6f Move SPOID Enable/Disable Logic Out of WVDrmPlugin
(This is a merge of http://go/wvgerrit/25580)

While writing fixes for b/36660726, b/34716264, and b/36065223, it
became clear that having the logic that checks whether the device
supports SPOIDs embedded inside WVDrmPlugin was complicating its code
and inhibiting testing of the class. By moving this check into the code
that instantiates WVDrmPlugin, the result of the calculation can be
independently tested while the tests for WVDrmPlugin can put it in
whatever state they need for the sake of unit testing.

As a consequence of this, the check on retrieving the "deviceUniqueId"
byte array property, which was removed when SPOIDs were implemented, can
be reinstated.

Bug: 36660726
Bug: 34716264
Bug: 36065223
Test: libwvdrmdrmplugin_hidl_test & libwvdrmengine_hidl_test
Change-Id: I961d2ee42bbdc42f0c324e36d9a74ac92205a437
2017-04-18 09:56:58 -07:00
Iliyan Malchev
28b89a9b4f Route drm@1.0-service.widevine libbinder to /dev/vndbinder
b/37309712: [Marlin/Sailfish] Fatal signal 6 (SIGABRT) when playing Exo
	    Player L1 encrypted content
Test: marlin

Change-Id: I05b12ea334138498be13bca92c9b1db6ed1b9870
Signed-off-by: Iliyan Malchev <malchev@google.com>
2017-04-14 01:22:04 -07:00
Jeff Tinker
6c15ea673d Corrections to widevine plugin for vts tests
Add a check for invalid session size in restoreKeys
and correct the return code when attempting to create a
plugin with an invalid uuid. Also correct the return code
when attempting to decrypt after keys have been removed.

bug:37172151
Change-Id: I7e832ffe04081471a0cdb3a9329808f47f12cfc3
2017-04-13 14:53:12 -07:00
Steven Moreland
20f8368f9c Fix transitive include.
Test: checkbuild
Change-Id: Iea1de496007556d2efac76092ef87ec2ec78b9bf
2017-04-06 17:39:39 -07:00
Edwin Wong
266898a352 Fix CTS post submit failures
MediaCodecTest.android.media.cts.MediaCodecTest.testCryptoError
was failing due to incorrect error code translation introduced
by the drm hidl hal.

Test: ANDROID_BUILD_TOP= ./android-cts/tools/cts-tradefed run cts
  --module CtsMediaTestCases --test
  android.media.cts.MediaCodecTest#testCryptoError

bug: 35137940
Change-Id: I5177367df7b57fe23a4b17c38462886786537140
2017-03-15 13:21:37 -07:00
Edwin Wong
2dc53442e7 Implement Widevine drm HIDL HAL service.
Modify Android mediadrm and mediacrypto glue layer to use
HIDL interface.

Test: Play Movies (streaming and offline playback)

Test: ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed
run gts -m GtsMediaTestCases

Test:
adb shell /system/bin/libwvdrmengine_hidl_test

Test:
adb shell /system/bin/libwvdrmmediacrypto_hidl_test

Test:
adb shell /system/bin/libwvdrmdrmplugin_hidl_test

bug: 34628973
Change-Id: Icd5f2dd556acb9874697963b4d7d62cb7c943e74
2017-03-02 13:46:11 -08:00