Commit Graph

2379 Commits

Author SHA1 Message Date
TreeHugger Robot
cd6178cf82 Merge "Unified State-Changing API for LicenseKeyStatus" into oc-mr1-dev 2017-08-31 23:45:41 +00:00
Rahul Frias
e492811200 Merge "Add SRM integration tests" into oc-mr1-dev 2017-08-30 20:57:06 +00:00
Adam Stone
5d2693536c Apply recommended type and name changes to metrics.
Bug: 36220619
BUG: 64071905

Test: Re-ran existing unit tests. Ran GTS tests. Tested with Google Play.
Change-Id: I79ddc8ed3290e6d74364cf96305054e55243c5ff
2017-08-29 17:12:44 -07:00
John W. Bruce
b8e31487a4 Unified State-Changing API for LicenseKeyStatus
(This is a merge of http://go/wvgerrit/31040)

Because the Policy Engine was only consulting the result of the Max-Res
Decode check when it was in kLicenseStateCanPlay and not in other states
that imply kKeyStatusUsable, like kLicenseStateWaitingLicenseUpdate, the
Max-Res Decode results would not be honored during the interval between
requesting a renewal and receiving the result. (Or until the key
expired.) This was particularly problematic for keys with renewal delays
less than ten seconds long, which would freeze the Max-Res state before
it had a chance to update for the first time, effectively disabling
Max-Res Decode until renewal was received.

Fixing this required changing how the Policy Engine and the
LicenseKeyStatus objects communicate about the changing usability state
of the LicenseKeyStatus objects. Before, a call to ApplyConstraints()
might calculate a Max-Res failure, but this failure would be pending
until the Policy Engine deigned to call ApplyStatusChange() again.
Without a call to ApplyStatusChange(), it could pend forever. This put a
burden on the PolicyEngine to poll the LicenseKeys with redundant
ApplyStatusChange() calls using the same CdmKeyStatus that the keys were
already in, just in case Max-Res had changed since the last necessary
call to ApplyStatusChange().

If the Policy Engine got the timing of these calls wrong, it would
result in Max-Res results being ignored. (as in the linked bug) If it
ever polled with the wrong CdmKeyStatus, it would update the
LicenseKeys' status when it did not mean to. It would be preferable if
this polling were not needed, so that the Policy Engine couldn't get it
wrong.

This patch changes the API between these classes so that when Max-Res
fails, the state change can be reported immediately instead of pending
until ApplyStatusChange() is called, eliminating the need for polling.
All state changes to the LicenseKeyStatus objects go through a unified
ApplyStatusChange() method that can update the CdmKeyStatus, resolution,
and/or HDCP level and report any resulting usability changes
immediately. This patch updates the unit tests to exercise this new API
instead of the old API.

Previously, the linked bug slipped past our unit tests because we only
test unrenewable, streaming licenses against Max-Res. This patch adds
several more variants to
policy_engine_constraints_unittest so that it tests six kinds of
license to provide better coverage.

Bug: 62393949
Test: build_and_run_all_unit_tests
Change-Id: I0dfdbf6b8ea39abb446089aef5f6ea0502e9b4c6
2017-08-29 16:37:49 -07:00
Rahul Frias
0c66866902 Add SRM integration tests
[ Merge of http://go/wvgerrit/30582 ]

Bug: 34285383

Test: WV unit, integration tests, cdm_feature_test.sh

Change-Id: I725150a12a589144e58ab04470d50ba9317a4c46
2017-08-29 12:14:57 -07:00
Adam Stone
c0133bf3a4 Merge "Create two new metric types to simplify metrics." into oc-mr1-dev 2017-08-26 20:26:08 +00:00
John W. Bruce
890f535b06 Silence Version Number Canary
(This is a merge of http://go/wvgerrit/32280)

At the same time as the last version number canary change went in, the
version number for O-MR1 was updated to its final value. Thus, the test
never stopped failing on the dashboard. This patch silences the canary
again. No Widevine version number update is needed, since we already
updated it for O-MR1 in the previous patch.

Bug: 64951985
Test: request_license_test
Change-Id: Idf3c4b96e3f200d08a089bd08afdee8b0fd9dd76
2017-08-24 16:04:38 -07:00
Adam Stone
466ec4e632 Create two new metric types to simplify metrics.
This is part one of a mult-part change to revise some metrics. Several
metrics are currently EventMetric type when they should be a simpler
type.

Test: Added unit tests for the new types. Also, re-ran existing tests.
Verified playback works with Google Play, and re-ran Widevine GTS tests.

Bug: 36220619
Change-Id: I2ec8fc355f66ad4834dd722aacd22541fb9c94ad
2017-08-24 12:19:17 -07:00
Fred Gylys-Colwell
481a1effcb Create new usage header if old one corrupted
Merge of http://go/wvgerrit/31561

If the usage table header is corrupted, or if it is stale, then the
CDM should create a new one.

bug: 64572642

Testing: pushed stale usage table to Fugu, and netflix recovered
gracefully.  New unit test UsageTableHeaderTest.StaleHeader.

Change-Id: Ic66854ff6b0b252a0f4ca20e09f27852a50d6fcc
2017-08-18 15:09:18 -07:00
John W. Bruce
ce9c5f35ac Update Widevine Android Version Number to 5.1.0
(This is a merge from http://go/wvgerrit/31360)

This also updates the version number change canary.

Bug: 64209738
Test: request_license_test
Change-Id: Ibdf27256822a32988a848ef5bf79bf2e2633fd59
2017-08-17 02:42:54 -07:00
Fred Gylys-Colwell
6e8f889795 Move Watchdog Timer to L3 Init Only
am: 1438873443  -s ours

Change-Id: I7c2e49318fd820af3a46a9ed792aa0e3c8725568
2017-08-11 04:08:43 +00:00
TreeHugger Robot
07edf821c4 Merge "Move Watchdog Timer to L3 Init Only" into oc-mr1-dev 2017-08-11 01:27:51 +00:00
Fred Gylys-Colwell
5bb2e55318 Move Watchdog Timer to L3 Init Only
Merge from Widevine repo of http://go/wvgerrit/31340

This CL moves the oemcrypto watchdog timer so that it only watches the
L3 initialization.  This will allow L1 initialization to take more
than 5 seconds if it needs to.

TEST: oemcrypto unit tests, Media GTS tests, Play Movies
b/64069544

Change-Id: I7826e4d72eda52ae8b2c9f8b3ac360fb42cbb115
2017-08-11 01:24:32 +00:00
Fred Gylys-Colwell
1438873443 Move Watchdog Timer to L3 Init Only
Merge from Widevine repo of http://go/wvgerrit/31302

This CL moves the oemcrypto watchdog timer so that it only watches the
L3 initialization.  This will allow L1 initialization to take more
than 5 seconds if it needs to.

TEST: oemcrypto unit tests, Media GTS tests, Play Movies
b/64069544

Merged-In: I7826e4d72eda52ae8b2c9f8b3ac360fb42cbb115

Change-Id: I7826e4d72eda52ae8b2c9f8b3ac360fb42cbb115
2017-08-11 01:23:15 +00:00
TreeHugger Robot
21715115bc Merge "Build widevine tests with BOARD_VNDK_VERSION set" into oc-mr1-dev 2017-08-09 02:32:48 +00:00
John Bruce
6dad75e395 Merge "Get System ID From OEM Cert" into oc-mr1-dev 2017-08-07 23:50:21 +00:00
TreeHugger Robot
0e52773ff7 Merge "Move widevine unit tests to vendor." into oc-mr1-dev 2017-08-07 23:40:40 +00:00
Jiyong Park
853773dd93 Build widevine tests with BOARD_VNDK_VERSION set
The tests are using vendor only libs such as libcdm and libwvlevel3,
thus marked as LOCAL_PROPRIETARY_MODULE to use the libs. In addition,
the dependency to libmedia is changed to libmedia_omx since libmedia is
not available to vendor modules. UniquePtr is replaced with
std::unique_ptr since UniquePtr.h in /libnativehelper is not available
to vendors (and will not be completely removed in a near future).

Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j tests

Change-Id: I4e9d3267b20c1d52f57664b89f15330e2ebd953d
2017-08-07 16:28:28 +09:00
Yifan Hong
5e8f727b71 Move widevine unit tests to vendor.
Test: BOARD_VNDK_VERSION=current m checkbuild -j
Test: ./build_and_run_all_tests.sh

Bug: 33241851
Change-Id: I97c8fcc84bc19d88e8aa941eb283089c8ecf47d5
2017-08-04 15:26:26 -07: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
4d448d8165 Get System ID From OEM Cert
(This is a merge from http://go/wvgerrit/30220)

Previously, extracting the system ID was only supported on Keybox-based
systems. This patch adds support for extracting the system ID from the
OEM Certificate chain on Provisioning 3.0 devices. This is done by
getting the Widevine intermediate cert from the chain, finding the
Widevine System ID extension in that cert, and extracting the value.

The code that does the extraction is separate from any code that calls
OEMCrypto so that it can be unit-tested in isolation. This patch adds a
crypto_session_unittest test to do this unit-testing.

Bug: 34776194
Test: crypto_session_unittest
Change-Id: I3e273968208fb31ae6019ccc383b419625d1ae22
2017-07-26 20:31:39 -07:00
Thierry Strudel
496b184ddd Merge commit '4e53212b0ea8f240f4345170e81abc8efba8feab' into oc-mr1-dev
Change-Id: I85c1a0cd5a6fa29ec4cf8a0f96f6cec32a7147ab
2017-07-25 16:55:09 -07:00
Rahul Frias
59daaa9dd4 Merge "Support provisioning 3.0" into oc-mr1-dev 2017-07-24 05:38:49 +00:00
Rahul Frias
e61259e075 Support provisioning 3.0
[ Merge of http://go/wvgerrit/29004 ]

Enable support for provisioning with OEM certificates as root of
trust.

b/62972441

Test: WV unit/intgration test, cdm_feature_test and GTSMediaTestCases

Change-Id: I30576fc0bb68a873eeaaca03f6b9c89fa6a14327
2017-07-23 18:00:23 +00:00
Thierry Strudel
4e53212b0e Revert "Temporarily disable WV L1"
This reverts commit 0bbbf7d84e.

Bug: 63632557
Change-Id: Icfd7ae4dda47449ad6178568c4bec18c898fa5b9
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-07-21 19:49:49 -07:00
Jeff Tinker
0d526131b9 Correct watchdog timeout
am: bfef9c5748

Change-Id: I07c5d81ba1289381a12b54a944c206c1845a21d0
2017-07-21 22:11:18 +00:00
Jeff Tinker
bfef9c5748 Correct watchdog timeout
The L3 initialization watchdog was previously configured
for 2 seconds vs 5 seconds as originally intended.

Change-Id: Ie31251ac7a58c11262963ef9cb56d0dc08f5dc5b
related-to-bug:62106796
2017-07-21 12:09:43 -07:00
Fred Gylys-Colwell
08debe83c2 Add watch dog timer to OEMCrypto L3
Merge from Widevine repo of http://go/wvgerrit/29861

This code adds a watchdog timer to the oemcrypto initialization.  If
initialization does not finish within 5 seconds, the process will
abort.

For branch oc-dr1-dev, unlike nyc-mr2-dev, we save a metric indicating
there was a failure.

Testing: see code in patch 1.  Watch dog was forced while using Play
Movies.  The busy spinner spun for at least 5 seconds, but Play Movies
was able to restart itself.

b/62106796

Change-Id: Ib59f5bc4a484eff1dc386e07a4b198ecb713c69b
2017-07-21 10:17:54 -07:00
Fred Gylys-Colwell
a81caa5bf1 Add watch dog timer to OEMCrypto L3 am: e20e909cbd
am: 6de0bd8486

Change-Id: I60c2d5848e4e731b048118fea88b0367e9cf31a3
2017-07-20 01:46:41 +00:00
Fred Gylys-Colwell
6de0bd8486 Add watch dog timer to OEMCrypto L3
am: e20e909cbd

Change-Id: I9298abc1539cb7170c5b11b14af5f7dacd09a970
2017-07-20 01:42:58 +00:00
Fred Gylys-Colwell
e20e909cbd Add watch dog timer to OEMCrypto L3
Merge from Widevine repo of http://go/wvgerrit/29861

This code adds a watchdog timer to the oemcrypto initialization.  If
initialization does not finish within 5 seconds, the process will
abort.

Testing: see code in patch 1.  Watch dog was forced while using Play
Movies.  The busy spinner spun for at least 5 seconds, but Play Movies
was able to restart itself.

b/62106796

Change-Id: Ib59f5bc4a484eff1dc386e07a4b198ecb713c69b
2017-07-19 16:35:46 -07:00
TreeHugger Robot
24a9ce769e Merge "Remove BoringSSL static targets in widevine." 2017-07-18 23:55:26 +00:00
Robert Sloan
02fb7421b9 Remove BoringSSL static targets in widevine.
Test: WidevineDashPolicyTests, MediaDrmTest, WidevineFailureTests, WidevineGenericOpsTests, WidevineH264PlaybackTests, WidevineHLSPlaybackTests, WidevineVP9WebMPlaybackTests, WidevineCodecStressTests

I saw (probably unrelated) in
com.google.android.media.gts.WidevineHEVCPlaybackTests#testL1WithUHD30
com.google.android.media.gts.WidevineH264PlaybackTests#testL1WithUHD30
com.google.android.media.gts.WidevineVP9WebMPlaybackTests#testVP9WebMCencSubSampleL1With240P30fps
com.google.android.media.gts.WidevineCodecStressTests#testVideoSecureH264
com.google.android.media.gts.WidevineCodecStressTests#testVideoSecureH265

BUG: 62945210
Change-Id: I5b5274d99ca5ad9299dc9cf9d83cb23fb6f6c13e
2017-07-18 21:44:52 +00:00
Edwin Wong
6cdf6d5a95 Merge "Check for nullptr IMemory." 2017-07-18 21:15:22 +00:00
TreeHugger Robot
d163337839 Merge "Add UniquePtr.h to libcdm" 2017-07-17 20:37:49 +00:00
Edwin Wong
d1a84b2bed Check for nullptr IMemory.
mapMemory can return a nullptr, must check for nullptr
IMemory.

Test: Play Movies (stream and pin movies)
Test: VtsHalDrmV1_0TargetTest

bug: 38386082
Change-Id: I66f9bfd08e36d575c7a45fe2eacd8fc981380c86
2017-07-17 09:54:00 -07:00
Jiyong Park
3d3655c4e6 Add UniquePtr.h to libcdm
The header in libnativehelper is not available for vendors building
against VNDK. So, copying it to local directory.

Bug: 63686260
Test: BOARD_VNDK_VERSION=current m -j libcdm
Change-Id: I5b6fd09103e2c2ae7c970fd898675aa4afe84ee2
2017-07-17 12:18:48 +09:00
John W. Bruce
740e1ca12b Report Widevine Version on Android
(This is a merge of http://go/wvgerrit/29282)

The Android API has long mandated that plugins respond to queries for a
version number, but we'd never hooked it up to the CDM's actual version
number until now.

Bug: 36867286
Test: libwvdrmdrmplugin_test
Test: libwvdrmdrmplugin_hidl_test
Change-Id: I952de4943f8e78b44d526bee66c54d31e9fe5ff1
2017-07-14 15:43:37 -07:00
John Bruce
f90e8e0027 Merge "Add SPOID Unit Tests" 2017-07-14 22:37:43 +00:00
Edwin Wong
06f8504688 Merge "Add property to query SRM support and version." 2017-07-14 17:25:29 +00:00
Jeff Tinker
d5d9d644d6 Temporarily disable WV L1 am: 0bbbf7d84e
am: 4477ef2901  -s ours

Change-Id: I7311088575039b95cdcfaa365374bdff5ffd0b90
2017-07-14 06:09:22 +00:00
Jeff Tinker
4477ef2901 Temporarily disable WV L1
am: 0bbbf7d84e

Change-Id: I40bb40b52d7de24108de0bf9afc85157ad1381af
2017-07-14 05:04:48 +00:00
Jeff Tinker
0bbbf7d84e Temporarily disable WV L1
For dogfooding, force fallback to widevine L3

bug:63673310
Change-Id: Ib222d4119e358ecfdaae44d1627d914a9b79d44e
2017-07-14 04:58:11 +00:00
Rahul Frias
a46a7182f9 Merge "Update error codes" 2017-07-14 01:18:42 +00:00
Edwin Wong
9f0adebb9f Add property to query SRM support and version.
Merge from http://go/wvgerrit/29800

Add QUERY_KEY_CURRENT_SRM_VERSION and
QUERY_KEY_SRM_UPDATE_SUPPORT.

Test: run unit test
  adb push $OUT/marlin/data/bin/libwvdrmdrmplugin_hidl_test
/vendor/bin/.
  adb shell LD_LIBRARY_PATH="/vendor/lib/mediadrm" \
    /vendor/bin/libwvdrmdrmplugin_hidl_test

bug: 63390310
Change-Id: Ie51056d22178565bd7b987aa901f7b7616d29328
2017-07-13 14:12:38 -07:00
Rahul Frias
346f8883c8 Update error codes
[ Merge from http://go/wvgerrit/29041 ]

This brings error codes up to date with wv master

b/62972441

Test: WV Unit/Integration tests on android

Change-Id: If676b35275bb992018b2b8bfcb76079a2fc2d1f9
2017-07-13 11:20:54 -07:00
Tom Cherry
fb0bbd740b remove extraneous using namespace android and deprecate utils/Log.h am: 6b2787121c
am: 6e8c82a416

Change-Id: Ic5c65fb6000a3a87feba28836d326618a347752f
2017-07-13 16:16:51 +00:00
Tom Cherry
6e8c82a416 remove extraneous using namespace android and deprecate utils/Log.h
am: 6b2787121c

Change-Id: I1c2e5311a126295a98650dde433c111b22d894b5
2017-07-13 16:13:55 +00:00
Tom Cherry
6b2787121c remove extraneous using namespace android and deprecate utils/Log.h
This namespace is not used by this file and its declaration is removed
in a separate CL from utils/Log.h, which is the only place it is
defined, so we must remove this extraneous line.

Also, since that separate CL is deprecating utils/Log.h in favor of
log/log.h, we make the switch to the new header.

Test: Build

Change-Id: Iac4bc8faffbd2d68dc4ccccaf569db0c5a13a7bc
2017-07-12 17:13:01 -07:00
John W. Bruce
4853871026 Add SPOID Unit Tests
(This is a merge of http://go/wvgerrit/29121)

This commit adds unit tests for globally unprovisioning with a SPOID and
to validate that SPOIDs vary in the expected ways depending on the
inputs they are given.

This change also fixes some indentation that was off and was getting
copied around the file.

Bug: 37179588
Test: libwvdrmdrmplugin_hidl_test
Change-Id: Ie9604b974228d151e1b32680c42824a66412bad7
2017-07-12 16:21:19 -07:00