Improve android MediaDrm property latency

[ Merge of http://go/wvgerrit/89848 ]

Apps query a number of properties at initialization. The mediaDrm
API getProperty allows the query of a single property at a time.
This causes a series of requests. If no crypto
sessions are concurrently open, a series of expensive OEMCrypto
Initialization and Termination calls will occur.

In this change OEMCrypto termination is delayed. If an OEMCrypto
Terminate is followed in close succession by an Initialize, neither
will occur avoiding the overhead. A timer enables a countdown process.
If no session activity occurs, the timer will eventually terminate
OEMCrypto and exit.

Bug: 136282358
Test: Android unit/integration tests
Change-Id: I442b7919b4e7835c52583516c8bc64d0c150241d
This commit is contained in:
Rahul Frias
2019-11-26 00:58:19 -08:00
parent 068035140b
commit 78d2fa5e9e
7 changed files with 243 additions and 108 deletions

View File

@@ -43,7 +43,10 @@ class Timer {
~Timer();
bool Start(TimerHandler* handler, uint32_t time_in_secs);
void Stop();
// Enable |wait_for_exit| only if the method is being invoked from a thread
// other than the timer thread. Deadlock might occur if enabled and called
// from the timer thread.
void Stop(bool wait_for_exit);
bool IsRunning();
private: