Merge from Widevine repo of http://go/wvgerrit/33540
This code adds a watchdog timer to the level 3 initialization. If
initialization does not finish within 5 seconds, the process will
abort, printing a small amount of debugging information.
arm/libwvlevel3.a Level3 Library 4445 Sep 11 2017 14:05:15
Test: unit tests on bullhead. Video on Play Movies.
Kyle ran the GTS tests on loop overnight.
bug: 65379279
Change-Id: I0e0e4b158dbce193abbd8ee2cf6b366060c768b8
[ Merge of http://go/wvgerrit/33340 ]
Update usage entry information only when usage entries are
supported.
Bug: 65483034
Test: wv unit/integration tests on angler
Test: GTS tests
Test: playback using play movies and netflix
Change-Id: If5a33900a30ce88f97ef46a800817cd4c71d195e
The app package name was not being reported to the media stats. This
change adds the package name as part of the report to media stats.
This is one of two parts to this change. The other part is in
frameworks/av.
Bug: 64584568
Test: Unit tests, GTS tests, tried with Google Play Movies.
Change-Id: I1ca09db3a59d9a0950f424d977f8774dffd09c2b
The test verifies that a downloaded license receives an expiry event
in a session if it is released from another session. With
the introduction of the big usage table feature loading a
license/usage entry into multiple sessions is not permitted and
so this test is no longer needed.
Some OEMCrypto implementations might require OEMCrypto_UpdateUsageEntry
to be called between calls to OEMCrypto_LoadKeys and
OEMCrypto_ReportUsage. This CL adds the call to
OEMCrypto_UpdateUsageEntry.
Test: WV unit/integration test
Test: Playback using play movies and netflix
Test: GTS tests
Bug: 64988654
Change-Id: Ic737c3200ea1858736a168be835507378eaf7b3e
[ Merge of http://go/wvgerrit/32940 ]
Releasing usage entries may cause other entries to be moved or
information updated. Instead of retrieving all entries once and trying
to release them, refetch them after each release.
Test: WV Unit/Integration tests
Test: GTS tests (failures seen, but no additional failures due to this CL)
Test: Playback testing using play movies and netflix.
Bug: 65372189
Change-Id: I700e60834c7f711c9146dfd720f9cac014981311
Merge from Widevine repo of http://go/wvgerrit/32880
This CL calls pthread_join on the watchdog thread to clean up its
stack and other memory usage.
Test: unit tests on bullhead, GTS tests run in loop,
Play Movies on bullhead.
bug: 65302198
Change-Id: I90f993333dfd019c1ffb96647a6472e4828d50aa
The metrics from the dynamic adapter were not previously being reported.
This change allows them to be reported when all other DRM metrics are
reported.
Bug: 64566432
Test: Unit tests, GTS tests, and Play movies.
Change-Id: I916fb028146fdd04b4cf5bbb5c10ecdaffae6c95
Merge from Widevine repo of http://go/wvgerrit/32067
PerOriginProvisioningSupportsOldPaths is changed to allow for there to
be several other device files.
bug:64952779
Test: unit tests on bullhead.
Change-Id: I0593d95a877c236c9a87c5893bbec22abe25fde9
Bug: 36220619
BUG: 64071905
Test: Re-ran existing unit tests. Ran GTS tests. Tested with Google Play.
Change-Id: I79ddc8ed3290e6d74364cf96305054e55243c5ff
(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
(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
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
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
(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
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
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
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
(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
[ 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
The L3 initialization watchdog was previously configured
for 2 seconds vs 5 seconds as originally intended.
Change-Id: Ie31251ac7a58c11262963ef9cb56d0dc08f5dc5b
related-to-bug:62106796
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
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
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
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
(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