[ Merge of http://go/wvgerrit/96071 ]
Changes to how the usage table method InvalidateEntry() behaves
required additional changes to CDM code that uses this method.
This involved some refactoring to AddEntry(), moving the LRU
related code to its own function.
A few unittests had to be changed / removed as the moving
multiple entries changes expectations of several existing tests.
Several additional helper methods have been created to improve
readability. These include getters for information about the
usage table, a method for releasing stale entries, and a method of
recording LRU metrics.
Bug: 150890014
Bug: 150887808
Bug: 154269671
Test: Linux unit tests and Android unit tests
Change-Id: I11a98f9a2dea9b2ae57b37d7d4483a37be721763
[ Merge of http://go/wvgerrit/95365 ]
The changes made to how DeleteEntry (now InvalidateEntry) works
introduced a few additional edge cases which were not covered from the
previous set of unit tests.
Bug: 150887808
Bug: 149100568
Test: Linux unit tests and Android unit tests
Change-Id: I263b72fb708c6546294af23ae5ddbd2e82da34df
[ Merge of http://go/wvgerrit/95406 ]
There was an issue with DeleteEntry() where it would result in an
invalid table state if shrinking the usage table when the number of
sessions is at its max.
This required changing how the usage table invalidates entries. Now,
after invalidating an entry (marking an entry as kStorageTypeUnknown)
the table is defragmented if specified to.
Defragmentation involves:
1) Move valid entries near the end of the table to the position of
invalid entries near the front of the table.
2) Shrinking the table to cut off trailing invalid entries.
This change updates the existing tests to pass, but still needs new
tests for some of the edge cases.
Bug: 150887808
Bug: 149100568
Test: Linux unit tests and Android unit tests
Change-Id: I70c7b296e5e4b367746fcdaabbf0f12dcfb39230
am skip reason: Change-Id I8d9234eec2b23a9c913e77a709943b431e25e43e with SHA-1 e27bc4ba6a is in history
Change-Id: Id159a3dd18e4443d3f132a349c58f1325054515d
am skip reason: Change-Id I8d9234eec2b23a9c913e77a709943b431e25e43e with SHA-1 e27bc4ba6a is in history
Change-Id: I088e628fc5917f0efca06e1cfd7860b31c491042
am skip reason: Change-Id I8d9234eec2b23a9c913e77a709943b431e25e43e with SHA-1 3c8acc3d56 is in history
Change-Id: Ibeb471001aa41463f8be034633cd9538b63f7d98
am skip reason: Change-Id I8d9234eec2b23a9c913e77a709943b431e25e43e with SHA-1 e27bc4ba6a is in history
Change-Id: Ic380e7d76d1518adc2a5e96789c23498cba749d4
am skip reason: Change-Id I8d9234eec2b23a9c913e77a709943b431e25e43e with SHA-1 e27bc4ba6a is in history
Change-Id: Ic9306fee543cd8a12d5476fb94d24198aed7538a
[ Merge of http://go/wvgerrit/97963 ]
There are situations where an offline license file will remain on the
system after it's usage entry has been deleted. This would result in
its key set ID being reported as present by the CDM, but any
operations acting upon it will result in an error.
The app should be able to remove the license without error, so long
as the license file exists and no other OEMCrypto operations fail.
This change introduces a new error code LICENSE_USAGE_ENTRY_MISSING,
which indicates that a license's usage entry cannot be found.
A new integration test checks that the CDM can handle the calls to
removeOfflineLicense().
Bug: 137034719
Test: Android unit and integration tests
Change-Id: Ibdbe963b7f7e3ac97b446300d8e3896cdee7abc5