Commit Graph

2097 Commits

Author SHA1 Message Date
John W. Bruce
c0a7655834 Maxing Out Sessions Can Cause SPOID Failures
(This is a merge of http://go/wvgerrit/25581)

To prevent dead DRM Plugins from being instantiated when there are no
sessions available, the time at which the device ID is queried has been
moved from instantiation-time to SPOID-calculation-time.

SPOIDs can now fail to be generated. Which means anything that depends
on a SPOID may fail because of this. However, this is a more actionable
problem for apps than having them receive a dead or unusable DRM Plugin
object.

Bug: 36660726
Test: libwvdrmdrmplugin_hidl_test
Change-Id: Ice6a8eabfee8d48bf2af02e2e7169aa95af9f2e4
2017-04-18 10:25:39 -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
TreeHugger Robot
6116fdb97a Merge "Translate CDM session not opened errors" into oc-dev 2017-04-14 21:38:30 +00:00
TreeHugger Robot
45910edd19 Merge "Add an offline test asset for the drm vts test" into oc-dev 2017-04-14 21:38:30 +00: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
3914953bff Add an offline test asset for the drm vts test
To test restoreKeys, a content configuration with a
license policy allowing offline playaback was needed.

Test: drm vts test

bug:34178477
Change-Id: Ib90d7a878c0f310569abb09f21138c7a6ac9daae
2017-04-14 00:30:07 -07:00
Jeff Tinker
f5240b69e4 Translate CDM session not opened errors
The drm hidl hal specifies that operations on sessions that
are not opened return ERROR_DRM_SESSION_NOT_OPENED.  This
change adds that translation, previously they were mapped
to unknown error.

Test: drm vts test

bug:34178477
Change-Id: I3777dd90eea7061f3fa5413a5732d7d58b85b49b
2017-04-14 00:28:47 -07:00
TreeHugger Robot
c3ea64aa89 Merge "Corrections to widevine plugin for vts tests" into oc-dev 2017-04-14 00:05:42 +00: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
Rahul Frias
ce62e1d7e7 Correct error returned when license is for the future
[ Merge of http://go/wvgerrit/25721 ]

Return CryptoException with errorCode ERROR_NO_KEY when an attempt is made
to make use of a license whose start time is in the future.

Test: Verified by WidevineDashPolicyTests#testL1LicenseStart2030

b/31914841

Change-Id: I2a157c227550a2391b6536365f34f1dfec3dea0c
2017-04-12 13:20:44 -07:00
John Bruce
1b0d67f368 Merge "Always Report OEMCrypto_ERROR_KEY_EXPIRED as NEED_KEY" into oc-dev 2017-04-12 17:48:58 +00:00
TreeHugger Robot
cc28abea0b Merge "Disable MinVersionNumber13 Test *DO NOT MERGE*" into oc-dev 2017-04-12 01:37:18 +00:00
TreeHugger Robot
dbaacf9232 Merge "Address merge comments" into oc-dev 2017-04-11 23:57:19 +00:00
TreeHugger Robot
eef94c002f Merge "Report binderized vendor service name" into oc-dev 2017-04-11 21:02:21 +00:00
TreeHugger Robot
9a69579330 Merge "Add checks for invalid parameters" into oc-dev 2017-04-11 21:01:25 +00:00
Fred Gylys-Colwell
f9d08a30a4 Disable MinVersionNumber13 Test *DO NOT MERGE*
Merge from Widevine repo of http://go/wvgerrit/25662

OEMCrypto v13 is required for OC MR1, and is not needed for OC.  This
CL disables the unit tests MinVersionNumber13 for OC.  This CL should
not be merged to master.

b/36866361

Test: all unit tests pass on sailfish.

Change-Id: I04d7b468ac9479257c25519acb6ac13204acabd5
2017-04-10 18:04:58 -07:00
John W. Bruce
7f27e5a266 Always Report OEMCrypto_ERROR_KEY_EXPIRED as NEED_KEY
(This is a merge of wvgerrit/25422)

OEMCrypto_ERROR_KEY_EXPIRED was not always being reported to the higher
layers as a NEED_KEY error, which could cause inconsistent error
handling.

Bug: 28294273
Test: Unit tests
Change-Id: Idf5642ea0f0ba915bc1f53025a1f14691d142aed
2017-04-10 16:49:44 -07:00
Jeff Tinker
bd87217173 Add checks for invalid parameters
Part of VTS test suite validation for
the binderized Widevine service

Test: Drm VTS test

bug:32815560
Change-Id: I0913c0e72487b5fdbf579b9ea3409c13264888fd
2017-04-10 10:06:26 -07:00
Jeff Tinker
dff3a13d6c Report binderized vendor service name
Update the vts vendor module to
return the service name instead of the
default passthrough service name to
support binderized mode.

Part of VTS test suite validation for
the binderized Widevine service

Test: drm vts test

Change-Id: I04c9fa6f66af43db6c405ecc8d714b712d87a45a
related-to-bug:34178477
2017-04-07 18:04:36 -07:00
Steven Moreland
20f8368f9c Fix transitive include.
Test: checkbuild
Change-Id: Iea1de496007556d2efac76092ef87ec2ec78b9bf
2017-04-06 17:39:39 -07:00
TreeHugger Robot
70d15e286f Merge "Add additional VTS drm tests for widevine" into oc-dev 2017-04-06 18:20:59 +00:00
Scott Randolph
cfcdceaa4f Use explicit .c_str() for hidl_string
hidl_string no longer will provide an implicit cast to const char* as it
interfers with other expected behaviors of the class.  It now emulated
std::string in requiring a call to .c_str() to get the same behavior.

Bug:  36532780
Test:  Build the tree
Change-Id: I2ce4354619a99d7c5ae8b39762d5506891ccd1ed
2017-04-06 10:58:56 -07:00
Edwin Wong
72f89a3b7f Merge "Remove dependencies from frameworks C++ containers." into oc-dev 2017-04-06 04:18:27 +00:00
TreeHugger Robot
8e041f9fd3 Merge "Fix compiler warnings" into oc-dev 2017-04-06 00:19:38 +00:00
Edwin Wong
d9e7070de7 Remove dependencies from frameworks C++ containers.
Replace AString, KeyedVector, List, String8 and Vector
with stl containers. Remove corresponding frameworks
libraries.

Test: Play Movies & TV (streaming and pinning)
Test: Netflix
Test: unit tests

bug: 34677927
Change-Id: I125f45054987d69bbca59c1ffdcbe8add38c3c13
2017-04-05 22:46:04 +00:00
Jeff Tinker
cfe80bc234 Add additional VTS drm tests for widevine
Also fixes a few cases where invalid inputs were
not checked.

bug: 34178477
Change-Id: I15c1e5f96e0843f484d8d3e29f548eac30d9dd80
2017-04-04 22:38:55 -07:00
TreeHugger Robot
82a0ed59fe Merge "Build libvtswidevine to relative directory." into oc-dev 2017-04-04 23:05:29 +00:00
Ryan Campbell
cdaeb0716c Build libvtswidevine to relative directory.
Build libvtswidevine module relative to the directory
drm-vts-test-libs.

Test: make vts; libvtswidevine.so is in correct place.
Bug: 36889176
Bug: 36817233
Change-Id: Iadb5bd6e71a1a7c99a69feff2ecb7bded90af24d
2017-04-04 13:26:01 -07:00
Fred Gylys-Colwell
d0a3568338 Address merge comments
Merge from Widevine repo of http://go/wvgerrit/24723

Several review comments were uncovered in the merge from oc-dev to
master. This CL addresses them.  This is just style changes in test
code.

http://go/wvgerrit/24318
http://go/wvgerrit/24301
http://go/wvgerrit/24316

Test: ran unit tests.

b/36451451

Change-Id: I257f8bf9b4fb5797e3da69578b48cd040cf61bfb
2017-04-04 12:31:59 -07:00
John W. Bruce
b99a4c736f Turn on 64-bit Executables on Supported Platforms
This commit changes the unit tests and HAL Service to run as 64-bit on
devices that have enabled 64-bit DRM Plugins.

Bug: 36076017
Test: Turned on the flag for a device and used the file command to
      verify that all binaries were built as 64-bit.
Test: Turned the flag back off and verified that all binaries were built
      as 32-bit. This should affect no current devices.
Change-Id: Ieb7218f15b9359f2038a6f60b8c994b16d2b5b53
2017-04-01 19:05:30 -07:00
Jeff Tinker
749ce0efcf Fix compiler warnings
Formats for size_t were incorrect

Change-Id: Ibdfdd734b9fe9e74e014fe10152ad8b9baf2d6f2
2017-03-31 16:19:41 -07:00
TreeHugger Robot
b3ea54b6dc Merge "Add checks for invalid parameters" into oc-dev 2017-03-31 05:29:54 +00:00
TreeHugger Robot
2b49e7c4ec Merge "DRM VTS Vendor module for widevine" into oc-dev 2017-03-31 05:29:54 +00:00
John Bruce
0fba3719e7 Merge "Fix & Improve Test-Building and -Running Scripts" into oc-dev 2017-03-31 00:56:55 +00:00
Jeff Tinker
76f43abcbe Add checks for invalid parameters
Part of VTS test suite validation

related-to-bug: 32815560

Test: drm hal vts test
Change-Id: I52be29cd46f535482a761f98acf6ff28870c061c
2017-03-30 16:15:01 -07:00
Jeff Tinker
01cb3cb787 DRM VTS Vendor module for widevine
This module is used with the drm VTS tests as part of HIDL/HAL
testing.  For background reference:
hardware/interfaces/drm/1.0/vts/doc/Drm_Vendor_Modules_v1.pdf

Change-Id: I38eb13696343e08fa2a1758219350d25698bfb7d
related-to-bug: 32815560
2017-03-30 23:07:11 +00:00
John W. Bruce
f2463075ac Fix & Improve Test-Building and -Running Scripts
(This is a merge of wvgerrit/24922)

This contains several fixes and improvements to the
build_and_run_all_unit_tests.sh and run_all_unit_tests.sh scripts:

* All tests are now identified as vendor binaries and thus are stored in
  the /vendor/bin/ directory instead of /system/bin/. Previously, some
  tests had moved to /vendor/bin/ but the scripts had not been updated,
  causing these tests to fail to run.
* The -j parameter can now be passed to build_and_run_all_unit_tests.sh,
  for those who want to speed up their build by using multiple cores.
* The 64-bit library directories are now added to the library search
  path, in anticipation of devices with 64-bit DRM Plugins.
* Checking for Verity protection is now done in
  build_and_run_all_unit_tests.sh (which is the script that actually
  modifies the file system) instead of just in run_all_unit_tests.sh.
* The library search path is no longer set unnecessarily for
  libwvdrmengine_hidl_test.
* The Treble-only tests and non-Treble-only tests now only run on
  devices that meet their respective criteria.

Bug: 36071236
Test: Ran build_and_run_all_unit_tests.sh
Change-Id: Iea236880c4445858111c801dfa278a528bca0f6c
2017-03-29 19:01:04 -07:00
Edwin Wong
957d4a30dd Fix testOEMCryptoVersion
Merge from go/wvgerrit/24882:

The result of crypto_session.GetApiVersion is misinterpreted.

Test: ANDROID_BUILD_TOP= -gts/tools/gts-tradefed run gts
 -m GtsMediaTestCases --test com.google.android.media.gts.
 MediaDrmTest#testOemCryptoVersion

Test: ANDROID_BUILD_TOP= -gts/tools/gts-tradefed run gts
 -m GtsMediaTestCases --test com.google.android.media.gts.
 MediaDrmTest

bug: 36728950
Change-Id: I72a05608f778fa81689013d3b231010b71329ea1
2017-03-29 15:49:59 -07:00
Fred Gylys-Colwell
92dff24180 Merge "Disable new unit tests for old oemcrypto" into oc-dev 2017-03-29 20:22:23 +00:00
Edwin Wong
54061a8bb8 Widevine HAL must not access mediametrics binder service.
Widevine HAL is not part of framework/system image and thus it is not
permitted to use Binder. Binder-like mechanisms which are permitted are
HwBinder  or VendorBinder (for communications only with vendor image
components).

Remove references to MediaAnalyticsItems used by ami_adapter.*.

Test: Play Movies & TV (streaming and pinned content)
Test: Netflix
Test: Widevine unit tests

bug: 36576915
Change-Id: I786f206c01d7c5ebfce719f3f51f5f7927f0359e
2017-03-28 14:24:02 -07:00
Fred Gylys-Colwell
17da2fbfdd Disable new unit tests for old oemcrypto
Merge from Widevine repo of http://go/wvgerrit/24863

The oemcrypto unit tests GenericKeyDecryptSameBuffer and
GenericKeyDecryptSameBuffer require features in oemcrypto v12, so they
should not be run on devices that report oemcrypto v11 or earlier.

b/36071236

Test: Unit tests run on Ryu and Bullhead.
Change-Id: Ia6645559ed98cae8d9807a14d6f0e514c5c4c615
2017-03-28 13:29:01 -07:00
John W. Bruce
bfe6046199 Build Android Unit Tests 32-bit Only
(This is a merge of http://go/wvgerrit/24738)

The change to enable 64-bit as a possible target for Widevine Android
made all the unit tests build as 64-bit on compatible platforms. Since
none of these devices support 64-bit properly yet, this is a mistake.
This patch restores unit test builds to being 32-bit only for now.

In the future, when the switch for 64-bit-supporting devices is added,
it will also switch the unit tests to 64-bit mode.

Bug: 36071236
Test: Verified unit test format with "file" command.
Change-Id: Ib4d3678181f3221b85fe6409f1d842dd15af3daa
2017-03-23 17:09:15 -07:00
TreeHugger Robot
99566d48e9 Merge "Clean Up Warnings in Android Glue Code" 2017-03-23 19:52:49 +00:00
Fred Gylys-Colwell
85365a1497 Fix or ignore compiler warnings
Merge from Widevine repo of http://go/wvgerrit/24688

b/35466719

Change-Id: If89f0cad0c61f37536a84f8dadaf08072356343a
2017-03-22 14:07:08 -07:00
John W. Bruce
92d26ff87e Clean Up Warnings in Android Glue Code
(This is a merge of go/wvgerrit/24739)

This cleans up some warnings in the Android glue code:

1) Checking if unsigned values are >= 0.
2) Using {0} initializer syntax instead of fully expanding to {0,0}.

Bug: 34394125
Test: Verified compilation passes
Change-Id: Id59730b97da7fce320f634451a44a4df4bf0b494
2017-03-22 11:08:32 -07:00
Edwin Wong
c4aad89fd0 Rename libhidl_utils to libwidevinehidl_utils.
This library is local to vendor/widevine HAL service, rename to
indicate this is used only by widevine HAL.

Test: Play Movies & TV (streaming and pinned)

Test: Netflix

bug: 36430909
Change-Id: Iacaf78f4223bf305569e7f1d04dd4e4ad0a87727
2017-03-20 11:14:36 -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
Rahul Frias
2ec7ec27bb Address warnings in CDM unittests
[ Merge of http://go/wvgerrit/24600 ]

Test: Unit test only change. Verified by rerunning unittests.

b/36221430

Change-Id: I36a8a0a5df400673689280cbf53ba9394f827c90
2017-03-14 12:13:12 -07:00
Adam Stone
dd88c13fb1 Trim unnecessary CDM metrics.
Bug: 35269103
Test: Removing unnecessary code. Existing tests pass.
Change-Id: I1ba8572a8b3fabbf707e77b366717c9ba3069ace
2017-03-13 19:10:39 -07:00
John Bruce
5cd6622a75 Merge "Enable SPOIDs in Treble Widevine Glue Layer" 2017-03-10 03:17:52 +00:00