Commit Graph

48 Commits

Author SHA1 Message Date
Treehugger Robot
5da7481869 Merge "Migrate from android::String path functions to std::filesystem" into main 2023-08-31 20:30:03 +00:00
Tomasz Wasilczyk
fd9ffd1d15 Migrate from android::String isEmpty to empty
This empty method is different from the old one - it aligns with
std::string definition.

Bug: 295394788
Test: make checkbuild
Change-Id: I890b3dfa930002f4406e9d9aec024f94ada1cad0
2023-08-31 17:48:47 +00:00
Tomasz Wasilczyk
259940cfc8 Migrate from android::String path functions to std::filesystem
Bug: 295394788
Test: m checkbuild
Change-Id: I57d0752e0579776308571c3a77a0072041ed68c5
2023-08-28 20:49:45 +00:00
Robert Shih
7ba9c9906d DrmManager: choose plugin load path based on arch
Bug: 202629223
Test: DRMTest#testForwardLockAccess
Change-Id: I2ff04a0a7b73c1397114a532f83f845042a023fa
2022-04-20 15:40:10 -07:00
Alistair Delva
5721cc4be3 Fix 64-bit build issues
Fix some type comparisons/mismatches:

- msg->what() is uint32_t (32-bit), not size_t (64-bit)
- std::max() for long long (128-bit) vs int64_t (64-bit)

Bug: 158659480
Change-Id: Ic00e6097c3ec8286e9759d286017b5e936779368
2020-09-13 22:51:48 -07:00
Robert Shih
7bcf792dd8 DrmManager: locally aggregate API metrics
Aggregate DrmManager API invocation counts per plugin over at least
fixed period of time before sending metrics to mediametrics service.

The default period is 1 day; the period is configurable through the
property drmmanager.metrics.period.

Bug: 134789967
Test: dumpsys media.metrics
Change-Id: I2cf28f1dfaa485ca319360705b872eed995b3d7f
2020-02-19 06:20:14 +00:00
Ray Essick
f27e987d27 Naming consistency: MediaAnalytics to MediaMetrics
Bug: 145780674
Test: build, boot, dumpsys media.metrics
Test: atest mediametrics_tests CtsNativeMediaMetricsTestCases
Change-Id: Icbfa98da9e61702aee9a1d807b5e126b4b9c6458
2019-12-17 11:20:57 -08:00
Andy Hung
a87e69cf8b MediaMetrics: Make submit one-way
Remove the unused session id to improve speed and clarity.

Test: dumpsys media.metrics sanity, mediametrics_tests
Change-Id: Ide5e9218811e110997fed19f43eb6a5fdc5812ec
2019-10-21 11:56:06 -07:00
Robert Shih
ec056aea5c DrmManager: record usage with libmediametrics
Bug: 134789967
Test: dumpsys media.metrics
Change-Id: I153244203aef0d8b9034efe4ff26f42028aadd7c
2019-08-21 17:29:29 -07:00
Jeff Tinker
5d49bef800 openDecryptSession() should consistently return sp<DecryptHandle>
Test:run cts-dev --module CtsDrmTestCases -t android.drm.cts.DRMTest

bug:79378662
Change-Id: Id46e63e3e0faf76ec98a77d7d439e5ccbc85e20f
2018-10-05 15:58:26 -07:00
Jeff Tinker
be4401f6c4 Don't load legacy plugins from /vendor/lib/drm
Only the OMA forward lock plugin remains and it is
loaded from system/lib/drm.

bug:38114169
Change-Id: I8768656c08482b406cacc6d050ff4df72ddca888
2017-05-15 12:03:12 -07:00
Chih-Hung Hsieh
aee0669a7b Merge "Fix clang-tidy warnings in drm."
am: e055519839

Change-Id: I99159fb0391af796445ea24265d088d20d178077
2016-08-09 23:35:06 +00:00
Chih-Hung Hsieh
8c0164ca98 Fix clang-tidy warnings in drm.
* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: Idf1c48d7bfe3f0da20401cb3ff1983ec00be170d
2016-08-09 14:20:59 -07:00
Chih-hung Hsieh
f64686f3b8 Merge "Fix misc-macro-parentheses warnings." am: 64d4f64af0
am: 5405ce02c4

* commit '5405ce02c45b55c0ba12fd3131ae329506e91f94':
  Fix misc-macro-parentheses warnings.

Change-Id: I94cd974549d819d7a43733636ecd4a6e464b76eb
2016-05-19 19:12:38 +00:00
Chih-Hung Hsieh
92c6b825ad Fix misc-macro-parentheses warnings.
Bug: 28705665
Change-Id: I1ad468741c6f117817099d2ba87374dce2b776a9
2016-05-17 15:20:14 -07:00
Mark Salyzyn
5a8dbe7ad3 drm: unused argument warning messages
Change-Id: Ifd8a470ffa02f986427c5f36380d70494efe864d
2016-03-31 21:10:54 +00:00
Aurimas Liutikas
b2231171d8 Fix more unused parameter warnings in frameworks/av/drm.
Bug: 27151704
Change-Id: Id153f12623b5d9d447f3f0605c30caf8743c367c
2016-02-12 16:57:08 -08:00
Mark Salyzyn
3ab368e081 media: use size_t for integer iterator to Vector::size()
Change-Id: I0a744dc7815a86a993df9b0623440be620ec8903
2014-04-15 14:57:31 -07:00
Jeff Tinker
f355f18aa2 Remove obsolete drm manager code
bug: 9545965
Change-Id: Ia6e09efa826b1349d027045e782980daeb7d7596
2013-07-23 11:32:15 -07:00
Henrik B Andersson
13f7fe763b Fix for not ending up in an eternal loop in DrmManager.
In the original code a random number is used to get try
to find an empty slot in the list of free DRM id's.
When you reached the limit of 0xfff id's you ended up
in an eternal loop causing ANRs.

Updated by James Dong <jdong@google.com>.

Change-Id: I70176cc3f770223c4a8060f9739fe2bc03a703d9
2013-01-24 12:49:26 -08:00
James Dong
bf5b3b29e3 Let getOriginalMimeType() take a fd passed from drm java applications
This patch enables the drm framework to avoid opening files directly.
As a result, the drm framework no longer needs the sdcard read permision.

o related-to-bug: 6426185

Change-Id: Ib176c35ef4b1a1a405e8e954f19a7985266f2510
2012-08-10 17:38:19 -07:00
Kei Takahashi
cba7b32d8f Add a new API on DRM Framework for streaming
In case of DRM streaming, decrypt session can start just after
receiving the header, and it doesn't need to wait for the entire
content. However, current API of DRM framework only accepts file
handle or URI. With this new API, DRM session can start
without waiting for the entire content.

Changes are made by SEMC and Sony.

Change-Id: I74375fe127df636067f1c300ea91654ba3d1aa3c
2012-05-23 14:44:06 -07:00
James Dong
9d2f386dd2 Separate sniffing from session initialization
This avoid lengthy/duplicate sniffing for drm plugins when a decrypt session is opened

o The change is backward compatibile in that no update is required
  for existing drm plug-ins if they do not plan to provide separate
  sniffer/extractor

related-to-bug: 5725548

Change-Id: I7fc4caf82d77472da4e2bc7b5d31060fb54fd84c
2012-01-12 16:25:12 -08:00
James Dong
2a3d6e1b6c am 3f6a7d1e: am d70c64db: Revert the following patches because they may lead to power regression because SHA/MD5 module is stuck 1. Revert "Fix drm flag setting missed in false drm recognition fix." This reverts commit 9f704f6c46a171357e49c411c83458b9d4565f3b.
* commit '3f6a7d1ee961a4544563932b7499535dc1cac1ec':
  Revert the following patches because they may lead to power regression because SHA/MD5 module is stuck 1. Revert "Fix drm flag setting missed in false drm recognition fix."    This reverts commit 9f704f6c46a171357e49c411c83458b9d4565f3b.
2011-12-14 13:53:31 -08:00
James Dong
785ee06d10 Revert the following patches because they may lead to power regression because SHA/MD5 module is stuck
1. Revert "Fix drm flag setting missed in false drm recognition fix."
   This reverts commit 9f704f6c46a171357e49c411c83458b9d4565f3b.

2. Revert "Fixed the false drm recognition."
   This reverts commit aadbd80b307c817698ce5110ff8e002804d1b230.

3. Revert "Fix drm enumeration order, resolves failure to play forward lock ringtones"
   This reverts commit a5cbf023e349f2394ba6fc58d73b4375cfec4369.

4. Revert "Fix ANRs due to Widevine DRM plugin sniff taking too long."
   This reverts commit d0d19db1ca1c289b069db33f4665bcb9386064e9.

As a result of the reverting, many ANRs from WV sniffing are back.

related-to-bug: 5739618
2011-12-14 11:01:59 -08:00
The Android Open Source Project
50a44951ba am f14dc291: Merge from ics-mr1
* commit 'f14dc29104340f8ccf9d42aef8dba2cc23f7f5e1':
  Fix drm enumeration order, resolves failure to play forward lock ringtones
2011-12-12 15:39:17 -08:00
Jeff Tinker
a9d421d3c0 Fix drm enumeration order, resolves failure to play forward lock ringtones
Change-Id: I58e8a26849409bc3bf98b066c5e07c2a0c91e0c9
related-to-bug: 5735466
2011-12-09 20:04:17 -08:00
Steve Block
3856b090cd Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2011-10-26 09:57:54 +01:00
Edwin Wong
5f6f4e4e89 Modified loadPlugIns to load from /vendor and /system; skip libraries that are already loaded.
BUG: 5284436

Change-Id: I99267c81a488860c3c7edb747100d44f3083bfc2
2011-09-21 21:50:31 -07:00
Gloria Wang
8f00151cbe Fix for bug 4371230.
- Generate unique ID for each DrmManagerClient in native side
- Fix the bug where multiple clients could use the same ID
- Return the correct unique ID back to Java
- Add a flag in the unique ID to separate native client and Java client

Change-Id: Ia4574b6b0a526f2335a65380975dc62f9a6e7f9b
2011-07-25 16:09:58 -07:00
James Dong
adfb559262 Fix memory leak from retrieval of getSupportedDrmInfo.
Change-Id: Ic2192a9791c0a3c5e5357b4367a2d8bfb15af20c
2011-04-24 12:40:16 -07:00
Gloria Wang
1006c80903 Merge "Bug fixes of DRM framework." 2011-03-15 14:10:30 -07:00
Gloria Wang
8d2577b9ac Bug fixes of DRM framework.
- Add death listener to clean-up drmserver appropriately
  when drmserver died.
- Remove "static" declaration of mUniqueIdVector because it was not
  needed to be static variable.
- Remove "class DrmContentIds;" because the class does not exist.
- contentPath in saveRights() could be empty because
  it is not required by some DRM schemes.
- Fix naming convention to use sXXX for static variables.
- Fix typo

Change-Id: I7d440488fc074c200f1009d1bafafeffebd690b2
2011-03-15 11:17:22 -07:00
Gloria Wang
0e0a5f9e0b - Some change on the DrmManager in order to support feature request 4082089.
In DrmManager, we currently lock both processDrmInfo() and onInfo() which is
    ok for now since processDrmInfo() is async call, and it will return without
    waiting for onInfo() call. However, if we send an event in processDrmInfo(),
    we will got deadlock here because we need to invoke onInf() which will wait
    for processDrmInfo() to release the lock. Use different lock for onInfo().
- Remove some redundent mutex lock.

Change-Id: I59c794f95ba1693425723224114fa975cf9b235f
2011-03-11 14:54:23 -08:00
Gloria Wang
6b610a3d31 - Change level of some LOGs from LOGE to LOGV because those logs
are not error logs from non-DRMed content's point of view.
- Add more mutex lock to avoid crash by multi-thread calls.
- Fix for bug 4050039

Change-Id: I52fed22069f0cda6c4ac6a5363469168c797a33b
2011-03-09 15:51:46 -08:00
Gloria Wang
7f89d09c0f To support DRM files without file extension
Change-Id: Ie7701048d0dbd51bf358364014a1b41c894b664c
2011-03-02 12:33:00 -08:00
Glenn Kasten
e7be8fe9ae Merge "Bug 3229711" 2011-01-12 09:31:46 -08:00
Glenn Kasten
fc4f5aad4a Bug 3229711
Change-Id: I3a4d41597cb92a1526417a622390dbb93dc71e99
2011-01-11 17:15:49 -08:00
Gloria Wang
ac2652c25f am 9e0bb6d5: am 0544d059: Merge "DRM Framework bug fixes."
* commit '9e0bb6d5eef5dfe2da60c50f3aaa39512307d11d':
  DRM Framework bug fixes.
2011-01-11 14:55:56 -08:00
Takeshi Aimi
c618b5af98 DRM Framework bug fixes.
- Make sure to clean-up obsolete listeners.
- Close cursor after using it.
- Add virtual destructor to the base class of OnInfoListener.

Changes are made by SEMC and Sony.

Change-Id: Ibb6dd625ef48e3597188f0d7c90f9d4c780b6139
2010-11-30 16:27:42 +09:00
Gloria Wang
6dc4726e7f am 24a90c26: am d9334934: Merge "Update of DRM Framework."
* commit '24a90c2674270fee0783bafa54fd5d845bdf0c18':
  Update of DRM Framework.
2010-11-22 21:29:08 -08:00
Gloria Wang
a2cd44cb50 64-bit file size/offset support for DRM framework
Change-Id: I0ba7147607825234df9fa28732e1bba344e82e79
2010-11-19 15:52:32 -08:00
Takeshi Aimi
3473846f64 Update of DRM Framework.
-Access permission handling
  Introduce an internal function which allows the desired process to
  access decryption flow. This new function is just for reference and
  each OEM manufacturer should implement/replace with their solutions.
-New API, getMetadata()
  This API is for retrieving media metadata from container-based DRM,
  such as OMA forward-lock content. This API asks DRM agent to retrieve
  media metadata hiddein inside of DRM special container.
-New API, acquireRights()
  This API wraps acquireDrmInfo() and processDrmInfo().
  If DRM agent has valid implementation of both APIs,
  Application can acquire DrmRights only by calling this API.
-Bug fix in event loop of OnInfoListener.
  Separate OnInfo event loop from mail thread loop so as to avoid
  the issue that message is not dispatched when mail thread is busy.

Changes are made by SEMC and Sony.

Change-Id: I04ee3e0988152a71e221f2256d83253749a29da0
2010-11-19 22:02:51 +09:00
Gloria Wang
b251f75d5c resolved conflicts for merge of a8d7b747 to master
Change-Id: I8a4b72c9f9a10de8bbc285e00e2dd5cb9f498349
2010-11-03 11:39:04 -07:00
Gloria Wang
5a6d148790 Disable some logs
Change-Id: I05fcf6869916504367814fd2abd2b1af88619f5b
2010-11-02 15:09:43 -07:00
Takeshi Aimi
e943f84129 Update of DRM framework
- Overload openDecryptSession() with uri parameter
   in order to accept URI of DRM content,
   Following API is added,
       DecryptHandle*openDecryptSession(const char* uri);.
 - Unify texisting three event types of processDrmInfo()
   so that caller of DRM framework does not have to handle many event types.
 - Let DrmManagerService call load/unload plugins API so that
   client of DRM framework does not have to manage plug-in load/unload.
 - Trivial fix in DrmManagerClient.java is also incorporated.

Changes are made by Sony Corporation.

Change-Id: If62b47fa0360718fdc943e6e6143671d7db26adc
2010-11-02 08:06:06 +09:00
Takeshi Aimi
2272ee27d9 Update of DRM framework.
- Change "void" type of return value to "int" for returning status.
  - Add some of overloaded Java APIs which accept database Uri as input.
  - Add asynchronous APIs
  - Add OnEventListener and OnErrorListener for asynchronous APIs
  - Disable debug log
  - Change decrypt() API to accept an optional buffer needed by some of DRM schemes

Changes are incorporated by Sony Corporation.

Change-Id: I414a165e22cc79be6ea7cd28041788aa2b6b8f7c
2010-10-04 22:14:53 +09:00
aimitakeshi
27ed8ad2db Initial contribution from Sony Corporation.
Add DRM Framework to support DRM content playback
  together with StageFright.

  - DRM Framework code is added
     - include/drm
     - drm
  - api/current.xml is updated to include DRM Framework Java APIs
  - cmds/servicemanager/service_manager.c is modified
    to add drmManager and drmIOService.

Change-Id: I6d7bc9c7067362b500e530988a9ce241761866fb
2010-09-01 15:40:00 +09:00