46 Commits

Author SHA1 Message Date
Steven Moreland
5c091dc944 Merge "frameworks/base: use proper nativehelper headers"
am: 826eafd958

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2017-07-20 02:50:53 +00:00
Steven Moreland
2279b25342 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Edwin Wong
4d1d84e8a0 Pass application packagename to drm plugin.
Get the application packagename to be used as part of a unique
identifier for drm plugin.

Test: Stream movies through Play Movies, Netflix and
Gts MediaCodecCencPlayer tests.
Verify the application's packagename is reachable in the drm plugin's
debug log.

bug: 27101531

Change-Id: I6473b58d78bc34191aca5896bb1f5fb79107ae47
2017-01-07 23:59:40 -08:00
Chih-Hung Hsieh
0b5608015b Merge "Fix misc-macro-parentheses warnings in audio media jni." am: 9ecb10d1b5
am: ca3f49d594

* commit 'ca3f49d594f5c00e6b5d6817bcdb0af02e7224e6':
  Fix misc-macro-parentheses warnings in audio media jni.

Change-Id: I3828c9720f7fe91bc60058daeca2d598f0302d32
2016-05-24 18:56:37 +00:00
Chih-Hung Hsieh
0ca16ef3b8 Fix misc-macro-parentheses warnings in audio media jni.
Bug: 28705665
Change-Id: Iff476943a0a2c2ae68778d1f4bca5d3e9e04bd26
2016-05-19 15:14:54 -07:00
Jeff Tinker
d12b7c0600 Remove MediaDrm stack from mediaserver
Part of media security hardening

MediaDrm was temporarily allowed to
run in either mediaserver or mediadrmserver
while all nexus devices were implementing
support for the native_handle representation
of secure buffers.  Now that all nexus
devices support native_handle, the MediaDrm
stack can be removed from mediaserver.

b/22990512

Change-Id: I96a5222f94cd1580ac411de5b48beb44b99cc8d7
2016-04-27 00:49:15 +00:00
Jeff Tinker
dc614f86a5 Add mediadrm service
Part of media security hardening

This is an intermediate step toward moving
mediadrm to a new service separate from mediaserver.
This first step allows mediadrmservice to run based
on the system property media.mediadrmservice.enable
so it can be selectively enabled on devices that
support using native_handles for secure buffers.

bug: 22990512
Change-Id: I9af073d8383f25657938d07be90c21c0dc6126b7
2016-02-12 20:23:45 -08:00
Jeff Tinker
dade24c12a Remove unused MediaDrm.unprovisionDevice
bug:25726218
Change-Id: Ibbd51aaa1ee4c21c9ec8b162fc6e378ab7ba6e7b
2015-12-09 09:02:31 -08:00
Elliott Hughes
b57dd722f1 resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Daniel Micay
76f6a86de2 constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04:00
Jeff Tinker
314b7f3af3 Improve robustness of MediaDrm after mediaserver crash
If DEAD_OBJECT is returned from binder calls due to
mediaserver crash, throw new MediaDrmResetException.
This allows the app to detect the condition and handle
it properly.

bug: 20614102
Change-Id: Id08b08fb612672fd94383f0470f5fa3f267b944f
2015-06-17 09:32:58 -07:00
Jeff Tinker
5ffbae6492 MediaDrm API Updates per api council review
bug: 21044671

Change-Id: Ifb34e7b8cb53f7bd5737c0869fc6c1f731ba1c9c
2015-05-15 01:44:59 +00:00
Jeff Tinker
74797f843c Add expiration update and keys change events
In support of unprefixed EME

bug: 19771612
bug: 19771431
Change-Id: Iddef695cfa1a56363a4c173249597e415cb93f50
2015-04-09 22:44:36 +00:00
Jeff Tinker
4cdc2de0e4 Report key request message type for unprefixed EME
bug: 19771299
Change-Id: If76fa2988ca45632d0afff601c12f8f5f9908ed1
2015-03-23 16:23:12 -07:00
Jeff Tinker
5609a32366 am 0d22633e: am 62632e25: Merge "Handle NULL keys and NULL values in MediaDrm JNI HashMap"
* commit '0d22633e07a6911403383a22bb3164f53b4f4409':
  Handle NULL keys and NULL values in MediaDrm JNI HashMap
2015-03-13 18:43:36 +00:00
Jeff Tinker
62632e25f5 Merge "Handle NULL keys and NULL values in MediaDrm JNI HashMap" 2015-03-13 18:20:43 +00:00
Ronghua Wu
a6d72095ed drm: add EVENT_SESSION_RECLAIMED for resource manager.
Bug: 19265536
Change-Id: Ifa15a4c7d3a7c20cb00bd4aefb57d239c0efaafa
2015-03-04 15:26:42 -08:00
Jeff Tinker
2888e90701 Revert "Fix Crash when sending null in HashMap to getKeyRequest"
This reverts commit 5bec0266358f28a91b38f8aefbcb918219aa4ce9.

Change-Id: I78c2f04be03dbdf8da6ea1e1f600c7c12668e433
2014-12-12 19:35:12 +00:00
Daniel Broms
35d6a4f75b Handle NULL keys and NULL values in MediaDrm JNI HashMap
If getKeyRequest() of MediaDrm was called with a HashMap containing
NULL keys or NULL values then the mediaserver crashed.

This modification adds NULL checks and throw
IllegalArgumentException as expected.

Change-Id: Ide82efe0f6bd28c8ac3f9aa048d9794f2ccc8fac
2014-11-24 07:31:31 +01:00
Jeff Tinker
5bec026635 Fix Crash when sending null in HashMap to getKeyRequest
Merge of partner https://android-review.googlesource.com/#/c/115665

Change-Id: I50235dc09be584165155019a70708377ca9688a0
2014-11-20 18:39:59 +00:00
Andreas Gampe
cba06c2272 resolved conflicts for merge of 6957369d to lmp-mr1-dev-plus-aosp
Change-Id: Ie3bd0e24c69c0c7ae500b8eb4a1198650e993a19
2014-11-10 19:41:52 -08:00
Andreas Gampe
5a15d0d31b Frameworks/base: Wall Werror in media/jni
Turn on -Wall -Werror in media/jni. Fix warnings.

Change-Id: I9da54ad379d8172ee535b52ee2b0637a2533f4e3
2014-11-10 18:19:40 -08:00
Jeff Tinker
1b51c72e91 Add missing secure stop methods
b/18053197
b/18076411

Change-Id: Ide9ecab2fd2021f3544491f23ae84c394c48ac14
2014-11-03 16:22:04 -08:00
Jeff Tinker
2979986b57 Fix exception message string formatting in MediaDrm
bug: 17281760
Change-Id: If527234d2efb1507eca8703027e3cbdd53961b9e
2014-08-27 11:05:13 -07:00
Jeff Tinker
6bf5b600d6 Allow device to be unprovisioned
bug: 12247651
Change-Id: Ie2e77566d2c65925091296da5bcbec327985c946
2014-08-01 17:16:01 +00:00
Jeff Tinker
d712e1a387 Add diagnostic error code to MediaDrm IllegalStateExceptions
bug: 13976775
Change-Id: I682dd66a79252a9ee030b3cab5deb350e653e933
2014-06-20 13:41:30 -07:00
Jeff Tinker
600071ca78 Allow DRM plugins to be destroyed when released
bug: 13411994
Change-Id: I5b4ac137ebfbaa61bc37f8344ab6ff3a7f6c0099
2014-04-11 16:11:15 -07:00
Jeff Tinker
65c94e6959 Add signature|system permission to MediaDrm signer APIs
Also addresses style issues noted in post-submit review from
https://googleplex-android-review.git.corp.google.com/#/c/439054/

Change-Id: If177b11dbcc049bc271529c119bc5c36ae0107b5
related-to-bug: 12702350
2014-04-02 16:43:10 -07:00
Jeff Tinker
e4095a80b6 Support CAST V2 Authentication in MediaDrm
Java API version

Update frameworks to enable support for CAST
V2 Authentication in the DRM Plugin.

Change-Id: I23cfbbbc89c1226b7a3968ce8bc1e2d4bd41014a
related-to-bug: 12702350
2014-04-01 14:25:35 -07:00
Jason Sams
868173a53f Merge "Fix a JNI local reference leak in MediaDrm" 2014-01-11 00:42:20 +00:00
Patrik2 Carlsson
265551a164 Fix a JNI local reference leak in MediaDrm
A reference leak was found in the subtitle usecase that also
applies to android_media_MediaDrm.cpp
(Code taken from the similar fix in android_media_MediaPlayer.cpp)

Change-Id: Icc4b25e4adc9a600ff4ac99a7a8478bb55a6e348
2013-12-19 10:59:42 +09:00
Narayan Kamath
f11dd63e0c MediaDrm#mNativeContext is a long, not int.
Therefore, we must use SetLongField and not SetIntField.

Change-Id: I2a805dd6b7c8e4905e742d8632d941f381a05930
2013-12-18 16:58:36 +00:00
Ashok Bhat
656fd04026 AArch64: Use long for pointers in MediaDrm and MediaMuxer
For storing pointers, long is used in MediaDrm and
MediaMuxer classes, as native pointers can be 64-bit.

Change-Id: I77f26cde627baf0dce70b6aa3a4dbd974051d9a6
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-10 18:10:47 +00:00
Ruben Brunk
87eac99a21 Remove dependency on JNIHelp header side effects.
Bug: 10680559
Change-Id: I47870d6c48906e0a420c52b7bc5945ffe29c68a2
2013-09-10 20:47:43 -07:00
Jeff Tinker
7cda491321 Add ability to test supported content types to MediaDrm
bug: 10244066
Change-Id: Ic96c2e23f36809faf1c88ede500f4bc2bad4142a
2013-08-21 17:30:06 -07:00
Jeff Tinker
8117d8f702 Fix JNI method called with exception pending
bug: 10313912
Change-Id: I8390905334f2e37f210adced52c31e7a431d4f55
2013-08-16 13:46:02 -07:00
Jeff Tinker
3ed38266c1 Define error codes for MediaCodec.CryptoException
Define specific failure cases so apps have the information they
need to deal with these conditions.

Also adds a new ResourceBusyException to MediaDrm

Change-Id: Iaecf269d58108f28179974b05671bf29b9fe4b7d
related-to-bug: 10157154
related-to-bug: 9695816
2013-08-03 10:23:41 -07:00
Jeff Tinker
606ab4706d Merge "Improve exception error messages to help diagnose app errors" into jb-mr2-dev 2013-05-22 19:12:39 +00:00
Jeff Tinker
17b8922785 Fix invalid keyType translation in MediaDrm.getKeyRequest
bug: 9070897
Change-Id: Ib9b4174e08b1c828d0204e0ab65bc3d7c2efcedf
2013-05-21 13:00:58 -07:00
Jeff Tinker
eada5376d9 Improve exception error messages to help diagnose app errors
bug: 9072051

Change-Id: I45057951d1a62b1b4a996e85f01601239e1b7161
2013-05-21 12:55:59 -07:00
Jeff Tinker
1d7c218ba2 MediaDrm API: Add two exceptions to handle error path scenarios
bug: 8725707
Change-Id: Ia00c495ac591cc2993f4d11ad3480b59833d009e
2013-04-30 12:39:04 -07:00
Jeff Tinker
f7568b5ee9 Improve error handling for DRM errors reported by plugins
Change-Id: I25df78f16379b32c54189949daa3ab9c91187375
related-to-bug: 8621516
2013-04-17 16:46:49 -07:00
Jeff Tinker
e1c76bebef Make MediaDrm APIs public
bug: 8603279

Change-Id: I9fab2673867ad413a084933cee7239d13e8b7893
2013-04-17 15:24:48 -07:00
Jeff Tinker
54cfbd6dc2 Implement async event callout from drm plugin to Java app
Change-Id: I451b7c6f766aafac39ce432a71ef5a03bffe29f1
2013-04-03 12:01:59 -07:00
Jeff Tinker
16b8cffb28 MediaDrm API update
Clarify offline usage of sessions and keys and implement
implement CryptoSession to support additional crypto use
cases.

Change-Id: Id3f8c706e9e3034b09af8e2a6a2f26bd74a49f93
2013-04-01 21:59:35 -07:00
Jeff Tinker
8a0c80fdcc Implementing MediaDrm APIs
Change-Id: Ib6eeb9c04c5c5cf1d485f9004cd3e6a1047a1d19
2013-03-13 13:40:56 -07:00