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 test cases
Change-Id: I8581aed1871d728f7af80b246d0dba28b40fa4a3
The shared library path was incorrectly set based on
the drm.64bit.enabled flag. It should be set based
on whether the drm service is running as 32-bit or
64-bit.
Test: vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target
bug:111289939
Change-Id: I388dc87bd4566211dc2901feccf1e6e1c90bfe67
Merged-In: I388dc87bd4566211dc2901feccf1e6e1c90bfe67
In change id Ie2f306bce6aec697ae584da3f55b3cf72edaa07b, a
shared memory leak was fixed using a workaround that
maintained compatibility with the frozen DRM HAL API
1.1. Unfortunately it triggered an error log message that
was no longer an error condition. This change just removes
the log line to avoid raising undue concerns.
Change-Id: I9abe08ef5ab86b2f8589a5c1e5c5175e19ab09d2
Test: Compiles
Bug:111131173
The shared library path was incorrectly set based on
the drm.64bit.enabled flag. It should be set based
on whether the drm service is running as 32-bit or
64-bit.
Test: vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target
bug:111289939
Change-Id: I388dc87bd4566211dc2901feccf1e6e1c90bfe67
When calling update-makefiles.sh there are
some unrelated changes that were missed in
previous commits.
Bug: 8675309
Test: compilation
Change-Id: I5bf67fbcc809de36bde1869ada7b835566a5198b
* The testEnvBase template is only used to register the testing hal.
* The service name is specifically determined by the test logic, so
disable the feature for vts to run the test against all service
instance (by setting HalServiceCombMode::NO_COMBINATION)
Bug: 64203181
Test: make vts
vts-tradefed run vts -m VtsHalDrmV1_0Target
vts-tradefed run vts -m VtsHalDrmV1_1Target
Change-Id: Ib2e005e8ccbc815067f0e9455fcd3e6c5ec151fb
Vendors implementing the newly added MediaDrm.setSecurityLevel
HAL found that it was difficult to implement properly. Also the
semantics are somewhat ambiguous from the Java platform API
level. The APIs have changed to bind the security level
assignment to openSession which clarifies the API for apps as
well as making it more natural to implement in HAL modules. This
CL updates the VTS tests to account for those changes.
bug:72831697
bug:64001680
test: VtsHalDrmV1_1TargetTest, GTS media tests
Change-Id: I2adf13f9da7726b206df6fcc82b1e2e11fc94674
During development of the vendor/widevine HAL module, the newly added
MediaDrm.setSecurityLevel method was found to be difficult to
implement efficiently since the security level is needed at the time
a session is opened. This CL moves the security level parameter to
openSession to resolve this problem.
bug:72831697
bug:64001680
test: VtsHalDrmV1_1TargetTest, GTS media tests
Change-Id: Id9c765131d0ee6fa85f83d098955acf603229b46
Adds test cases for the getMetrics call in the DRM 1.1 HAL clear key
implementation.
Bug: 64001680
Test: VtsHalDrmV1_1TargetTest
Change-Id: I7c292f79f7477a6a88296aa62eae02cc70e35102
Test: VtsHalDrmV1_1TargetTest
Methods are for querying HDCP, security levels
and number of sessions.
Change-Id: Iaa865a0201a4c10b0c6b055aabab146dd31a2d01
Methods are needed to release a secure stop by ID and
return a list of secure stops.
Tests: gts media tests
bug:67361434
bug:64001680
Change-Id: I53cb0671b9b775e8da16bcc61008e1700466180b
Also added the appropriate type information for exporting metrics from a
plugin.
Bug: 64001676
Bug: 64001680
Change-Id: I9ccd4fbcf7201990e6d08c24e814e24833459a23
Test: Verified that the interface builds. No implementation, yet.
Two additional KeyRequestTypes have been added, None and Update. None
indicates that no key request is needed as keys have already been loaded.
Update indicates that while keys have previously been loaded, an
additional (non-renewal) license request is needed.
Bug: 70335058
Test: make
Change-Id: I43b7491110871332c3a79573773c441c2a4f5ccb
New methods are for querying HDCP, security levels and
number of sessions
bug:64001680
bug:33657579
Change-Id: Idb3d66a805ac530221536058614e0df8460e627b
bug:70205403
Test: manual play movies test forcing the legacy default
widevine plugin to be used, instead of the widevine hidl
service.
Change-Id: Icb5b234999c5bf49b31d967814e48d42d9dd767f
Removing whenever I see these in code reviews.
Test: none
Merged-In: I4322f533a837d55618ec2ed2125e8966ace9d61d
Change-Id: I4322f533a837d55618ec2ed2125e8966ace9d61d
To stay close to the original test, the only time the test will abort is
when it encounters errors in Setup.
The following changes are applied in this CL:
- #include <openssl/aes.h> should be sorted alphabetically
- gtest macro should follow convention of ASSERT_EQ(expected, actual)
- removed unused variables: num, ecount_buf and kNotSecure
- TestQueryKeyStatus needs to call closeSession()
- moved and renamed test dependent global constants:
e.g. k256SubSampleByteCount, k512SubSampleClearBytes and k512SubSampleEncryptedBytes
- use isOK() for checking Status::OK, e.g.
ASSERT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());
Test: VTS test
adb shell /data/nativetest/VtsHalDrmV1_0TargetTest/VtsHalDrmV1_0TargetTest
bug: 68735305
Change-Id: Ic8f43b4c35644bf7223f24a531eae818e59e0f4a
AesCtrDecryptor::decrypt() doesn't check whether the size of "key" is
equal to 16 bytes, which may lead to an OOB read problem in the context
of mediadrmserver. The fix is in clearkey plugin. Add tests to validate
the fix.
Test: VTS test
adb shell /data/nativetest/VtsHalDrmV1_0TargetTest/VtsHalDrmV1_0TargetTest
bug: 63982768
Merged-In: Ife2da17e7f39d8031bc36b83c3b27ba5e9d83eb7
Change-Id: Ife2da17e7f39d8031bc36b83c3b27ba5e9d83eb7
1. Fix the following issues:
- queryKeyStatus is now implemented, do not return
ERROR_DRM_CANNOT_HANDLE anymore
- expectedKeyRequest and knownKeyResponse should use
'-' and '_' instead of '+' and '/' for base64Url encode;
one uint8_t change from 0x2b to 0x2d for each vector
2. Add tests to create clearkey drm and crypto plugin using
both common pssh box format system ID and clearkey scheme
UUID.
Test: Vts test on Marlin and Taimen
adb shell /data/nativetest/VtsHalDrmV1_0TargetTest/
VtsHalDrmV1_0TargetTest
Test: Cts ClearKeyTest on Marlin and Taimen
ANDROIOP= ./android-cts/tools/cts-tradefed run cts
-m CtsMediaTestCases
--test android.media.cts.ClearKeySystemTest
Test: ClearKey plugin unit tests
adb shell LD_LIBRARY_PATH="/vendor/lib/mediadrm"
/data/nativetest/ClearKeyDrmUnitTest/ClearKeyDrmUnitTest
Test: netflix and Play Movies & TV for sanity check
bug: 66327050
Change-Id: Icfbe715cf246a7c5253d5f104d0fd446618b18bd
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: I4e8fbee791ec917a8f627a1366f4d44ec7e6febc
As VTS tests are considered system and link against these.
Bug: 38302533
Bug: 62523241
Test: builds
Change-Id: Iac5c872c58ec9646d6d6974aacceb930daad7e5e
drm HAL has been using libmediadrm for android::SharedLibrary class and
android::PluginLoader class. This is a Treble violation since
libmediadrm is a framework-only library that is not available to
vendors.
To solve the problem, the two classes are copied into this directory
to form a small static library android.hardware.drm@1.0-helper.a.
Bug: 38302533
Test: mm under /hardware/interfaces/drm/1.0/default and
/hardware/interfaces/drm/1.0/vts/functional
Change-Id: I7b4e5cdb3bc815e971e0c3b7ec99ea86042e13eb
DRM cannot skip all tests when vendor modules are
not present. Currently even the clearkey tests are
skipping when there is no vendor lib. This can be
replicated by just pushing the DRM VTS test binary
build from master (or DR or MR) and executing the
binary without VTS. All test cases skip (including
clearkey).
This change prevents exiting when no vendor
modules are found.
Test: Push the test binary and confirm that the
clearkey tests run.
bug:64459011
Change-Id: Ic5f554d9b223d6ca4bf26f92f072254cc18f4620
Test for both ClearKey plugin UUIDs in DrmHalClearkeyFactoryTest.
Test: VTS - VtsHalDrmV1_0TargetTest
bug: 64386897
Change-Id: Id7f140518910a87efdf9eaa19ce16113e206264f
Update the Android.bp generated with hidl-gen.
Test: build with and without BOARD_VNDK_VERSION=current
Bug: 63866913
Change-Id: I1a9db1df49e0f13c5790da2b118ae9ec63ba34a7
Allow HAL definition libs to be static.
Bug: 32920003
Bug: 64040096
Test: update-all-google-makefiles.sh
Change-Id: I1483d572bea6799717d1614fb7d52fe225e31104
mapMemory can return a nullptr, must check for nullptr
IMemory.
Test: Play Movies (stream and pin movies)
Test: VtsHalDrmV1_0TargetTest
bug: 38386082
Change-Id: I0766380a5843415ef0260c26bd21d4b4051b20ea
Instead of relying on the global include paths, use the new headers lib
'media_plugin_headers'. Also, media/SharedLibrary.h is not used, thus deleted.
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j android.hardware.drm@1.0-service
Change-Id: I30d8bcb6315b734cef7ad082c432da51eb33119c
Rather than having a lib called libstagefright_foundation and one
called libstagefright_foundation_vendor, we now just have one library
and the build system keeps track of the vendor APIs that are exposed.
Test: (sanity) boot device, watch (part of) DRM protected movie.
Change-Id: I7495be3e8f546cac1b4909108313cf61fc85b1d8
As VTS tests are considered system and link against these.
Bug: 38302533
Bug: 62523241
Test: builds
Change-Id: Iac5c872c58ec9646d6d6974aacceb930daad7e5e
drm HAL has been using libmediadrm for android::SharedLibrary class and
android::PluginLoader class. This is a Treble violation since
libmediadrm is a framework-only library that is not available to
vendors.
To solve the problem, the two classes are copied into this directory
to form a small static library android.hardware.drm@1.0-helper.a.
Bug: 38302533
Test: mm under /hardware/interfaces/drm/1.0/default and
/hardware/interfaces/drm/1.0/vts/functional
Change-Id: I7b4e5cdb3bc815e971e0c3b7ec99ea86042e13eb
DRM HAL is a library in vendor. When BOARD_VNDK_VERSION is turned
on, any lib in vendor partition can only link against to other vendor
libs or libs marked as vendor_available:true. This lib is using
libstagefright_foundation and the lib is not available to vendors.
Instead, libstagefright_foundation_vendor is provided as a
vendor-variant of the foundation library. Thus switching to the vendor
variant.
Bug: 37462569
Test: m android.hardware.drm@1.0-impl
Change-Id: Iaee9886f9ba3643e1c19928690bad13c26ac29d7
This caused b/38343526 which is a chase list issue, reverting for now.
This reverts commit 4e1fe736af.
Change-Id: Ib9ffcd11e575e3f05f54cbea17fda2f2eb3780b5
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Merged-In: I08aaad80f7e2fc262aa3a8b66fe932e8133a928d
Change-Id: I08aaad80f7e2fc262aa3a8b66fe932e8133a928d
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Change-Id: I08aaad80f7e2fc262aa3a8b66fe932e8133a928d
DrmHalVendorFactoryTest.EmptyPluginUUIDNotSupported
was failing on 64 bit builds. The test was using
an uninitialized hidl_array as the empty UUID which
was incorrect. This change initializes the array
contents to null values.
Test: drm hal tests pass
bug: 37172151
Change-Id: I0acb86921f0daceba30fa7879980ce819db64a74
The DrmHalVendorPluginTest.RestoreKeysClosedSession test wasn't
taking into account the policy of the asset, so both streaming
and offline assets were included in the test which is incorrect.
Test: drm vts test passes
bug:37358379
Change-Id: I41116e77a1ae306bb1a484e3714360c8553590f0
Not all drm hal implmentations will be present on every device,
but the vendor modules will be. This change allows tests to be skipped
when a drm hal implementation isn't present.
Test: drm vts tests pass with widevine on a gms
device (tests executed) and tests pass on an aosp
device (tests skipped).
Change-Id: I0b87f501a45103960193279eb5b4b2cd1c113acd
Add a positive and two negative test cases for the restoreKeys
function in DRM vendor plugin.
Test: vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target
--primary-abi-only --skip-all-system-status-check
Bug: 34178477
Change-Id: Ia7f323dbd92e7281efa96b9b7d07b85123e819f4
A session wasn't being closed in the ListenerKeysChange
test, that was causing erratic behavior on subsequent tests.
The expected return code was incorrect in the test
AttemptDecryptWithKeysRemoved.
bug:37272108
Change-Id: I11590b85c81548622359d91ebc9af75276a7b58c
Previously only the vendor service name was used
to get the drm and crypto services, which would work
either for binderized or passthrough devices, but not
both. With this change, the vendor service name is
tried first, and failing that the default passthrough
service is used.
Change-Id: I05e9552da992e8d9dbba0f8dde485406262410a9
related-to-bug:34178477
Test: drm vts test
The drm vts event listener tests would hang if event
callouts failed to work as expected. Use the vts test
callback template instead.
Change-Id: I5234f5760d90c1e884badc25cd251da27c2c672d
related-to-bug:34178477
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h
Test: pass
Merged-In: Iff316b21bef556bb026378b7f89e97ded3febef4
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h
Test: pass
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
We are ready for devices to begin migrating to a 64-bit Legacy DRM
Loader. However, not all devices are ready to make this jump yet. A
device needs to have all of its Legacy DRM Plugins ready to run as
64-bit before it can do this. This includes having 64-bit hardware
integrations.
So that devices can turn on 64-bit support as they get ready, I am
adding flags that can be set in a device's device.mk file. There are two
parts:
* ENABLE_MEDIADRM_64 enables building the Legacy DRM Plugin HAL as
64-bit.
* Setting drm.64bit.enabled=true in PRODUCT_PROPERTY_OVERRIDES switches
the Legacy DRM Plugin HAL to searching for DRM Plugins in the 64-bit
directory.
Test: Validated that turning on these flags enables a 64-bit Legacy DRM
Plugin HAL that loads 64-bit Legacy DRM Plugins from the lib64
directory.
Bug: 36076017
Change-Id: I8d21fc7e7c0357eb6755839d41caa0f37ca20aff
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: I265590c7c18f425e44863df062a56b67519a932a
Should abort program if registerPassthroughServiceImplementation returns
something other than OK.
Test: Play Movies & TV in non-binderized mode.
bug: 34640335
Change-Id: I94be98e7ae66cdb777a7d182123c8692aef915b7
MediaCodecTest.android.media.cts.MediaCodecTest.testCryptoError
was failing due to incorrect error code translation introduced
by the drm hidl hal.
bug: 35137940
Change-Id: Ibd02425a55194f3cb0acc0e53f90b156023fb1ab
Not all drm schemes require provisioning. This change
updates the documentation to explicitly support it.
bug:36007160
Change-Id: Ia4dc471314d2cce92ce8d69258bf1d16d5104302
Legacy error codes need to be converted into new Status values before
being reported. Decryption errors (that were negative) were changed to
absolute values. This caused their translation to new Status values to
fail.
b/35634335
Test: Verified with GtsExoPlayerTestCases. Some failures, but those
are unrelated to this CL and will be addressed separately.
Change-Id: I995cac33cb2725d02b0f1a3922e522ce07a9d1be
The legacy plugin listener was not set when used in
passthrough mode in Treble. This caused events (session renewal,
key expired etc) not to be propagated to the app.
b/35375500
Test: In progress
Change-Id: I7d74b3320c82e22f67d3c804ee93f9b9791080b2
The initial drm hidl hal implementation assumed one
codec per crypto instance, but in fact there can be
multiple codecs per crypto instance. This change
extends the drm hal to allow multiple memory heaps
per crypto plugin. It fixes the issue of mapping
memory frequently during playback.
bug:35275191
Test: manual verification with Play Movies on angler
and in binderized mode on marlin
Change-Id: I0ec36856248623d2ad8acb8ce9873e9274883a40
bug:35329920
Tests: Verfied playback on Ryu with Play Movies in combination with
ag/1907708, ag/1909159
This reverts commit fbf3650370.
Change-Id: I4a35a329b24e4cd9efcff4fe84e9d8901c714d57
We need google shims on the vendor partition because they are providing
an implementation of a vendor defined interface. They were written by
google just as a courtesy/to make the transition easier. They're
basically a set for vendors to assemble their hal implementations
from.
Bug: 34135607
Test: marlin persist.hal.binderization on/off
Change-Id: I2e2af5af39264cf290259755bb9b2eb9827a21f5
A feature in O requires a small change to the
drm HAL: adding a parameter to the createPlugin
method in the DrmFactory.
bug:31306973
Change-Id: Iab0f7ee58103b357f10cf05ea7986a8fc01eebf6
Previously the drm and crypto plugins were separate hals.
This implied a separation of implementation libraries which
causes problems for some drm schemes. The reorganization
combines the hals into a single interface under drm.
Tests: basic gtests passing
Change-Id: I5cde6ff9f60625a0219731c4dbfcaefbd9f27f88
related-to-bug: 32815560
It had been removed since it didn't appear to be needed,
but was found to be necessary for functionality.
Test: gtests pass
Change-Id: Ib716a04218e8d5c81f5d7889a53dfa17beccecef
related-to-bug: 32815560