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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user