Revert "Core CDM: Removed secure stop support."

This reverts commit b039f31b27.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: I8cd6014b4e2de93b3c574d407d6c8885863fed4f
This commit is contained in:
Alex Dale
2022-12-03 00:46:22 +00:00
committed by Android (Google) Code Review
parent b039f31b27
commit 16a4c2690a
6 changed files with 660 additions and 139 deletions

View File

@@ -127,10 +127,10 @@ class CdmEngine {
// stored offline data associated with the session.
virtual CdmResponseType RemoveKeys(const CdmSessionId& session_id);
// This method removes all offline data associated with the session. It
// should be used with care, as it deletes the info immediately and
// without using a release message, so the server is not able to
// receive usage info or track releases for offline licenses.
// This method removes all offline data associated with the session, such as
// offline keys and usage info. It should be used with care, as it deletes the
// info immediately and without using a release message, so the server is not
// able to receive usage info or track releases for offline licenses.
virtual CdmResponseType RemoveLicense(const CdmSessionId& session_id);
// Construct valid renewal request for the current session keys.
@@ -235,32 +235,38 @@ class CdmEngine {
virtual CdmResponseType RemoveOfflineLicense(const std::string& key_set_id,
CdmSecurityLevel security_level);
// Usage related methods for streaming licenses with persistent usage
// information (deprecated).
// Usage related methods for streaming licenses
// Retrieve a random usage info from the list of all usage infos for this app
// id. If |error_detail| is not null, an additional error code may be provided
// in the event of an error.
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
int* error_detail,
CdmUsageInfo* usage_info);
// Retrieve usage info whose PST is specified by |ssid| (deprecated).
// Retrieve usage info whose PST is specified by |ssid|
// If |error_detail| is not null, an additional error code may be provided
// in the event of an error.
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
const CdmSecureStopId& ssid,
int* error_detail,
CdmUsageInfo* usage_info);
// Retrieve usage info for a given security level and whose PST is
// specified by |ssid| (deprecated).
// Retrieve usage info for a given security level and whose
// PST is specified by |ssid|.
// If |error_detail| is not null, an additional error code may be provided
// in the event of an error.
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
const CdmSecureStopId& ssid,
RequestedSecurityLevel security_level,
int* error_detail,
CdmUsageInfo* usage_info);
// Remove all usage records for the current origin (deprecated).
// Remove all usage records for the current origin.
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
CdmSecurityLevel security_level);
// Remove all usage records for the current origin. Span all
// security levels (deprecated).
// security levels.
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id);
virtual CdmResponseType RemoveUsageInfo(
@@ -400,6 +406,9 @@ class CdmEngine {
CdmSessionId* session_id);
bool ValidateKeySystem(const CdmKeySystem& key_system);
CdmResponseType GetUsageInfo(const std::string& app_id,
RequestedSecurityLevel requested_security_level,
int* error_detail, CdmUsageInfo* usage_info);
void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);
@@ -434,11 +443,13 @@ class CdmEngine {
std::string spoid_;
uint32_t user_id_;
// Tracks the time of the last update to usage info across all
// actively managed CDM sessions with loaded usage entries. Used
// to periodically update a usage entry associated with an active
// license.
int64_t last_usage_info_update_time_ = 0;
// Usage related variables
// Used to isolate a single active usage information license. Loading,
// creating or releasing a different usage licenses through the engine
// API will release the handle to previously active secure stop license.
std::unique_ptr<CdmSession> usage_session_;
std::unique_ptr<UsagePropertySet> usage_property_set_;
int64_t last_usage_information_update_time_;
// Protect release_key_sets_ from non-thread-safe operations.
std::mutex release_key_sets_lock_;