Rahul Frias 299b100fc8 Delete usage information on insufficient resources
[ Merge of http://go/wvgerrit/58460 ]

If OEMCrypto runs out of space in the usage table header+entries adding
a new license or loading/using an existing one might fail. This CL makes
two modifications to handle this scenario.

* OEMCrypto_ERROR_INSUFFICIENT_RESOURCES will be returned from
  OEMCrypto_CreateNewUsageEntry or OEMCrypto_LoadUsageEntry. An attempt
  will be made to release a LRU entry from the usage table and retry
  the operation. This may be retried 3 times unless success
  occurs earlier.

* On initialization, the usage table header is loaded. If there are more than
  the minimum number of usage entries (200), an attempt is made to
  add a usage entry. If this fails, we are likely in an unrecoverable
  state. We then delete all offline licenses, usage information and
  recreate the usage table header. This will allow future playback
  attempts to succeed and offline licenses to be able to be downloaded
  but will lose all current offline licenses and secure stops.

Bug: 112486006
Test: WV unit/integration tests, GtsMediaDrmTest
      Playback tests using Netflix and Play movies.

Change-Id: I41a18d69a329f8a96c7b607d299ce73af3d56177
2018-08-29 17:38:43 -07:00
2014-02-20 12:48:45 -08:00
Description
No description provided
1.1 GiB