Add device files error detail to metrics.

[ Merge from http://go/wvgerrit/71923 ]

Plumb through the device files error detail and add the detail to
metrics.

Bug: http://b/115382201
Test: Unit tests, manual GPlay.
Change-Id: I18139f6712b6670be5fed863a97f9f03440745c7
This commit is contained in:
Adam Stone
2019-02-01 11:28:03 -08:00
parent 605ff83103
commit 5b49bf83a2
10 changed files with 79 additions and 59 deletions

View File

@@ -228,7 +228,7 @@ class CdmEngine {
// id. If |error_detail| is not null, an additional error code may be provided // id. If |error_detail| is not null, an additional error code may be provided
// in the event of an error. // in the event of an error.
virtual CdmResponseType GetUsageInfo(const std::string& app_id, virtual CdmResponseType GetUsageInfo(const std::string& app_id,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info); CdmUsageInfo* usage_info);
// Retrieve the usage info for the specified pst. // Retrieve the usage info for the specified pst.
@@ -237,7 +237,7 @@ class CdmEngine {
// in the event of an error. // in the event of an error.
virtual CdmResponseType GetUsageInfo(const std::string& app_id, virtual CdmResponseType GetUsageInfo(const std::string& app_id,
const CdmSecureStopId& ssid, const CdmSecureStopId& ssid,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info); CdmUsageInfo* usage_info);
// Remove all usage records for the current origin. // Remove all usage records for the current origin.
@@ -363,7 +363,7 @@ class CdmEngine {
bool ValidateKeySystem(const CdmKeySystem& key_system); bool ValidateKeySystem(const CdmKeySystem& key_system);
CdmResponseType GetUsageInfo(const std::string& app_id, CdmResponseType GetUsageInfo(const std::string& app_id,
SecurityLevel requested_security_level, SecurityLevel requested_security_level,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info); CdmUsageInfo* usage_info);
void OnKeyReleaseEvent(const CdmKeySetId& key_set_id); void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);

View File

@@ -181,10 +181,10 @@ class CdmEngineMetricsImpl : public T {
} }
CdmResponseType GetUsageInfo(const std::string& app_id, CdmResponseType GetUsageInfo(const std::string& app_id,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info) override { CdmUsageInfo* usage_info) override {
CdmResponseType sts; CdmResponseType sts;
CdmResponseType error_detail_alt; int error_detail_alt;
M_TIME(sts = T::GetUsageInfo(app_id, &error_detail_alt, usage_info), M_TIME(sts = T::GetUsageInfo(app_id, &error_detail_alt, usage_info),
metrics_, cdm_engine_get_usage_info_, sts, error_detail_alt); metrics_, cdm_engine_get_usage_info_, sts, error_detail_alt);
if (error_detail != nullptr) { if (error_detail != nullptr) {
@@ -196,10 +196,10 @@ class CdmEngineMetricsImpl : public T {
CdmResponseType GetUsageInfo(const std::string& app_id, CdmResponseType GetUsageInfo(const std::string& app_id,
const CdmSecureStopId& ssid, const CdmSecureStopId& ssid,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info) override { CdmUsageInfo* usage_info) override {
CdmResponseType sts; CdmResponseType sts;
CdmResponseType error_detail_alt; int error_detail_alt;
M_TIME(sts = T::GetUsageInfo(app_id, ssid, &error_detail_alt, usage_info), M_TIME(sts = T::GetUsageInfo(app_id, ssid, &error_detail_alt, usage_info),
metrics_, cdm_engine_get_usage_info_, sts, error_detail_alt); metrics_, cdm_engine_get_usage_info_, sts, error_detail_alt);
if (error_detail != nullptr) { if (error_detail != nullptr) {

View File

@@ -60,12 +60,20 @@ class CdmSession {
const CdmSessionId* forced_session_id, const CdmSessionId* forced_session_id,
WvCdmEventListener* event_listener); WvCdmEventListener* event_listener);
// Restores an offline session identified by the |key_set_id| and
// |license_type|. The |error_detail| will be filled with an internal error
// code. The |error_detail| may be a CdmResponseType or other error code type.
// It is only suitable for additional logging or debugging.
virtual CdmResponseType RestoreOfflineSession( virtual CdmResponseType RestoreOfflineSession(
const CdmKeySetId& key_set_id, CdmLicenseType license_type, const CdmKeySetId& key_set_id, CdmLicenseType license_type,
CdmResponseType* error_detail); int* error_detail);
// Restores an usage session from the provided |usage_data|.
// The |error_detail| will be filled with an internal error code. The
// |error_detail| may be a CdmResponseType or other error code type. It is
// only suitable for additional logging or debugging.
virtual CdmResponseType RestoreUsageSession( virtual CdmResponseType RestoreUsageSession(
const DeviceFiles::CdmUsageData& usage_data, const DeviceFiles::CdmUsageData& usage_data,
CdmResponseType* error_detail); int* error_detail);
virtual const CdmSessionId& session_id() { return session_id_; } virtual const CdmSessionId& session_id() { return session_id_; }
virtual const CdmKeySetId& key_set_id() { return key_set_id_; } virtual const CdmKeySetId& key_set_id() { return key_set_id_; }
@@ -209,7 +217,9 @@ class CdmSession {
bool GenerateKeySetId(CdmKeySetId* key_set_id); bool GenerateKeySetId(CdmKeySetId* key_set_id);
CdmResponseType StoreLicense(); CdmResponseType StoreLicense();
bool StoreLicense(DeviceFiles::LicenseState state);
bool StoreLicense(DeviceFiles::LicenseState state,
int* error_detail);
bool UpdateUsageInfo(); bool UpdateUsageInfo();

View File

@@ -30,24 +30,27 @@ class DeviceFiles {
kLicenseStateUnknown, kLicenseStateUnknown,
} LicenseState; } LicenseState;
// All error response codes start with 5000 to avoid overlap with other error
// spaces.
enum ResponseType { enum ResponseType {
kNoError = 0, kNoError = NO_ERROR,
kObjectNotInitialized = 1, kResponseTypeBase = 5000,
kParameterNull = 2, kObjectNotInitialized = kResponseTypeBase + 1,
kBasePathUnavailable = 3, kParameterNull = kResponseTypeBase + 2,
kFileNotFound = 4, kBasePathUnavailable = kResponseTypeBase + 3,
kFileOpenFailed = 5, kFileNotFound = kResponseTypeBase + 4,
kFileWriteError = 6, kFileOpenFailed = kResponseTypeBase + 5,
kFileReadError = 7, kFileWriteError = kResponseTypeBase + 6,
kInvalidFileSize = 8, kFileReadError = kResponseTypeBase + 7,
kHashComputationFailed = 9, kInvalidFileSize = kResponseTypeBase + 8,
kFileHashMismatch = 10, kHashComputationFailed = kResponseTypeBase + 9,
kFileParseError1 = 11, kFileHashMismatch = kResponseTypeBase + 10,
kFileParseError2 = 12, kFileParseError1 = kResponseTypeBase + 11,
kUnknownLicenseState = 13, kFileParseError2 = kResponseTypeBase + 12,
kIncorrectFileType = 14, kUnknownLicenseState = kResponseTypeBase + 13,
kIncorrectFileVersion = 15, kIncorrectFileType = kResponseTypeBase + 14,
kLicenseNotPresent = 16, kIncorrectFileVersion = kResponseTypeBase + 15,
kLicenseNotPresent = kResponseTypeBase + 16,
}; };
struct CdmUsageData { struct CdmUsageData {

View File

@@ -285,7 +285,7 @@ CdmResponseType CdmEngine::GenerateKeyRequest(
if (license_type == kLicenseTypeRelease && if (license_type == kLicenseTypeRelease &&
!session->license_received()) { !session->license_received()) {
CdmResponseType error_detail = NO_ERROR; int error_detail = NO_ERROR;
sts = session->RestoreOfflineSession(key_set_id, kLicenseTypeRelease, sts = session->RestoreOfflineSession(key_set_id, kLicenseTypeRelease,
&error_detail); &error_detail);
session->GetMetrics()->cdm_session_restore_offline_session_.Increment( session->GetMetrics()->cdm_session_restore_offline_session_.Increment(
@@ -421,7 +421,7 @@ CdmResponseType CdmEngine::RestoreKey(const CdmSessionId& session_id,
} }
CdmResponseType sts; CdmResponseType sts;
CdmResponseType error_detail = NO_ERROR; int error_detail = NO_ERROR;
sts = session->RestoreOfflineSession(key_set_id, kLicenseTypeOffline, sts = session->RestoreOfflineSession(key_set_id, kLicenseTypeOffline,
&error_detail); &error_detail);
session->GetMetrics()->cdm_session_restore_offline_session_.Increment( session->GetMetrics()->cdm_session_restore_offline_session_.Increment(
@@ -1212,7 +1212,7 @@ CdmResponseType CdmEngine::RemoveOfflineLicense(
CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id, CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
const CdmSecureStopId& ssid, const CdmSecureStopId& ssid,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info) { CdmUsageInfo* usage_info) {
LOGI("CdmEngine::GetUsageInfo: %s", ssid.c_str()); LOGI("CdmEngine::GetUsageInfo: %s", ssid.c_str());
if (NULL == usage_property_set_.get()) { if (NULL == usage_property_set_.get()) {
@@ -1285,7 +1285,7 @@ CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
} }
CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id, CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info) { CdmUsageInfo* usage_info) {
LOGI("CdmEngine::GetUsageInfo: %s", app_id.c_str()); LOGI("CdmEngine::GetUsageInfo: %s", app_id.c_str());
// Return a random usage report from a random security level // Return a random usage report from a random security level
@@ -1315,7 +1315,7 @@ CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id, CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
SecurityLevel requested_security_level, SecurityLevel requested_security_level,
CdmResponseType* error_detail, int* error_detail,
CdmUsageInfo* usage_info) { CdmUsageInfo* usage_info) {
LOGI("CdmEngine::GetUsageInfo: %s, security level: %d", app_id.c_str(), LOGI("CdmEngine::GetUsageInfo: %s, security level: %d", app_id.c_str(),
requested_security_level); requested_security_level);
@@ -1652,7 +1652,7 @@ CdmResponseType CdmEngine::LoadUsageSession(const CdmKeySetId& key_set_id,
return LOAD_USAGE_INFO_MISSING; return LOAD_USAGE_INFO_MISSING;
} }
CdmResponseType error_detail = NO_ERROR; int error_detail = NO_ERROR;
CdmResponseType status = session->RestoreUsageSession(usage_data, CdmResponseType status = session->RestoreUsageSession(usage_data,
&error_detail); &error_detail);
session->GetMetrics()->cdm_session_restore_usage_session_.Increment( session->GetMetrics()->cdm_session_restore_usage_session_.Increment(

View File

@@ -24,8 +24,8 @@ namespace {
const size_t kKeySetIdLength = 14; const size_t kKeySetIdLength = 14;
// Helper function for setting the error detail value. // Helper function for setting the error detail value.
void SetErrorDetail(wvcdm::CdmResponseType* error_detail, template<typename T>
wvcdm::CdmResponseType error_code) { void SetErrorDetail(int* error_detail, T error_code) {
if (error_detail != nullptr) { if (error_detail != nullptr) {
*error_detail = error_code; *error_detail = error_code;
} }
@@ -210,7 +210,7 @@ CdmResponseType CdmSession::Init(CdmClientPropertySet* cdm_client_property_set,
CdmResponseType CdmSession::RestoreOfflineSession( CdmResponseType CdmSession::RestoreOfflineSession(
const CdmKeySetId& key_set_id, CdmLicenseType license_type, const CdmKeySetId& key_set_id, CdmLicenseType license_type,
CdmResponseType* error_detail) { int* error_detail) {
if (!initialized_) { if (!initialized_) {
LOGE("CdmSession::RestoreOfflineSession: not initialized"); LOGE("CdmSession::RestoreOfflineSession: not initialized");
return NOT_INITIALIZED_ERROR; return NOT_INITIALIZED_ERROR;
@@ -237,6 +237,7 @@ CdmResponseType CdmSession::RestoreOfflineSession(
"CdmSession::RestoreOfflineSession: failed to retrieve license. " "CdmSession::RestoreOfflineSession: failed to retrieve license. "
"sub error: %d, key set id = %s", "sub error: %d, key set id = %s",
sub_error_code, key_set_id.c_str()); sub_error_code, key_set_id.c_str());
SetErrorDetail(error_detail, sub_error_code);
return GET_LICENSE_ERROR; return GET_LICENSE_ERROR;
} }
@@ -306,7 +307,7 @@ CdmResponseType CdmSession::RestoreOfflineSession(
sts); sts);
return sts; return sts;
} }
if (!StoreLicense(license_state)) { if (!StoreLicense(license_state, error_detail)) {
LOGW( LOGW(
"CdmSession::RestoreUsageSession: unable to save updated usage " "CdmSession::RestoreUsageSession: unable to save updated usage "
"info"); "info");
@@ -320,8 +321,7 @@ CdmResponseType CdmSession::RestoreOfflineSession(
} }
CdmResponseType CdmSession::RestoreUsageSession( CdmResponseType CdmSession::RestoreUsageSession(
const DeviceFiles::CdmUsageData& usage_data, const DeviceFiles::CdmUsageData& usage_data, int* error_detail) {
CdmResponseType* error_detail) {
if (!initialized_) { if (!initialized_) {
LOGE("CdmSession::RestoreUsageSession: not initialized"); LOGE("CdmSession::RestoreUsageSession: not initialized");
return NOT_INITIALIZED_ERROR; return NOT_INITIALIZED_ERROR;
@@ -686,7 +686,8 @@ CdmResponseType CdmSession::RenewKey(const CdmKeyResponse& key_response) {
if (is_offline_) { if (is_offline_) {
offline_key_renewal_response_ = key_response; offline_key_renewal_response_ = key_response;
if (!StoreLicense(DeviceFiles::kLicenseStateActive)) if (!StoreLicense(DeviceFiles::kLicenseStateActive,
nullptr /* error_detail */))
return RENEW_KEY_ERROR_2; return RENEW_KEY_ERROR_2;
} }
return KEY_ADDED; return KEY_ADDED;
@@ -721,7 +722,7 @@ CdmResponseType CdmSession::GenerateReleaseRequest(CdmKeyRequest* key_request) {
} }
if (is_offline_) { // Mark license as being released if (is_offline_) { // Mark license as being released
if (!StoreLicense(DeviceFiles::kLicenseStateReleasing)) if (!StoreLicense(DeviceFiles::kLicenseStateReleasing, nullptr))
return RELEASE_KEY_REQUEST_ERROR; return RELEASE_KEY_REQUEST_ERROR;
} else if (!usage_provider_session_token_.empty()) { } else if (!usage_provider_session_token_.empty()) {
if (usage_support_type_ == kUsageEntrySupport) { if (usage_support_type_ == kUsageEntrySupport) {
@@ -846,7 +847,7 @@ CdmResponseType CdmSession::StoreLicense() {
return OFFLINE_LICENSE_PROHIBITED; return OFFLINE_LICENSE_PROHIBITED;
} }
if (!StoreLicense(DeviceFiles::kLicenseStateActive)) { if (!StoreLicense(DeviceFiles::kLicenseStateActive, nullptr)) {
LOGE("CdmSession::StoreLicense: Unable to store license"); LOGE("CdmSession::StoreLicense: Unable to store license");
return STORE_LICENSE_ERROR_1; return STORE_LICENSE_ERROR_1;
} }
@@ -891,15 +892,20 @@ CdmResponseType CdmSession::StoreLicense() {
return NO_ERROR; return NO_ERROR;
} }
bool CdmSession::StoreLicense(DeviceFiles::LicenseState state) { bool CdmSession::StoreLicense(DeviceFiles::LicenseState state,
DeviceFiles::ResponseType sub_error_code = DeviceFiles::kNoError; int* error_detail) {
return file_handle_->StoreLicense( DeviceFiles::ResponseType error_detail_alt = DeviceFiles::kNoError;
bool result = file_handle_->StoreLicense(
key_set_id_, state, offline_init_data_, key_request_, key_response_, key_set_id_, state, offline_init_data_, key_request_, key_response_,
offline_key_renewal_request_, offline_key_renewal_response_, offline_key_renewal_request_, offline_key_renewal_response_,
offline_release_server_url_, policy_engine_->GetPlaybackStartTime(), offline_release_server_url_, policy_engine_->GetPlaybackStartTime(),
policy_engine_->GetLastPlaybackTime(), policy_engine_->GetLastPlaybackTime(),
policy_engine_->GetGracePeriodEndTime(), app_parameters_, usage_entry_, policy_engine_->GetGracePeriodEndTime(), app_parameters_, usage_entry_,
usage_entry_number_, &sub_error_code); usage_entry_number_, &error_detail_alt);
if (error_detail != nullptr) {
*error_detail = error_detail_alt;
}
return result;
} }
CdmResponseType CdmSession::RemoveKeys() { CdmResponseType CdmSession::RemoveKeys() {
@@ -953,7 +959,7 @@ void CdmSession::OnTimerEvent(bool update_usage) {
policy_engine_->DecryptionEvent(); policy_engine_->DecryptionEvent();
has_decrypted_since_last_report_ = false; has_decrypted_since_last_report_ = false;
if (is_offline_ && !is_release_) { if (is_offline_ && !is_release_) {
StoreLicense(DeviceFiles::kLicenseStateActive); StoreLicense(DeviceFiles::kLicenseStateActive, nullptr);
} }
} }
policy_engine_->OnTimerEvent(); policy_engine_->OnTimerEvent();
@@ -1030,7 +1036,7 @@ CdmResponseType CdmSession::UpdateUsageEntryInformation() {
if (is_offline_) if (is_offline_)
StoreLicense(is_release_ ? DeviceFiles::kLicenseStateReleasing StoreLicense(is_release_ ? DeviceFiles::kLicenseStateReleasing
: DeviceFiles::kLicenseStateActive); : DeviceFiles::kLicenseStateActive, nullptr);
else if (!usage_provider_session_token_.empty()) else if (!usage_provider_session_token_.empty())
UpdateUsageInfo(); UpdateUsageInfo();

View File

@@ -279,10 +279,10 @@ class SessionMetrics {
ValueMetric<double> cdm_session_life_span_; // Milliseconds. ValueMetric<double> cdm_session_life_span_; // Milliseconds.
EventMetric<kErrorCodeFieldNumber, CdmResponseType> cdm_session_renew_key_; EventMetric<kErrorCodeFieldNumber, CdmResponseType> cdm_session_renew_key_;
CounterMetric<kErrorCodeFieldNumber, CdmResponseType, CounterMetric<kErrorCodeFieldNumber, CdmResponseType,
kErrorDetailFieldNumber, CdmResponseType> kErrorDetailFieldNumber, int32_t>
cdm_session_restore_offline_session_; cdm_session_restore_offline_session_;
CounterMetric<kErrorCodeFieldNumber, CdmResponseType, CounterMetric<kErrorCodeFieldNumber, CdmResponseType,
kErrorDetailFieldNumber, CdmResponseType> kErrorDetailFieldNumber, int32_t>
cdm_session_restore_usage_session_; cdm_session_restore_usage_session_;
EventMetric<kKeyRequestTypeFieldNumber, CdmKeyRequestType> EventMetric<kKeyRequestTypeFieldNumber, CdmKeyRequestType>
@@ -406,7 +406,7 @@ class EngineMetrics {
CounterMetric<kErrorCodeFieldNumber, CdmResponseType> CounterMetric<kErrorCodeFieldNumber, CdmResponseType>
cdm_engine_get_secure_stop_ids_; cdm_engine_get_secure_stop_ids_;
EventMetric<kErrorCodeFieldNumber, CdmResponseType, EventMetric<kErrorCodeFieldNumber, CdmResponseType,
kErrorDetailFieldNumber, CdmResponseType> kErrorDetailFieldNumber, int32_t>
cdm_engine_get_usage_info_; cdm_engine_get_usage_info_;
EventMetric<kErrorCodeFieldNumber, CdmResponseType> EventMetric<kErrorCodeFieldNumber, CdmResponseType>
cdm_engine_handle_provisioning_response_; cdm_engine_handle_provisioning_response_;

View File

@@ -90,8 +90,8 @@ void SetAttributeField<drm_metrics::Attributes::kLicenseTypeFieldNumber,
template <> template <>
void SetAttributeField<drm_metrics::Attributes::kErrorDetailFieldNumber, void SetAttributeField<drm_metrics::Attributes::kErrorDetailFieldNumber,
CdmResponseType>( int32_t>(
const CdmResponseType &error_detail, const int32_t &error_detail,
drm_metrics::Attributes *attributes) { drm_metrics::Attributes *attributes) {
attributes->set_error_detail(error_detail); attributes->set_error_detail(error_detail);
} }

View File

@@ -7,6 +7,7 @@
#include <sstream> #include <sstream>
#include "device_files.h"
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "google/protobuf/text_format.h" #include "google/protobuf/text_format.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
@@ -251,10 +252,10 @@ TEST_F(SessionMetricsTest, AllSessionMetrics) {
session_metrics.SetSessionId(kSessionId1); session_metrics.SetSessionId(kSessionId1);
session_metrics.cdm_session_life_span_.Record(1.0); session_metrics.cdm_session_life_span_.Record(1.0);
session_metrics.cdm_session_renew_key_.Record(1.0, NO_ERROR); session_metrics.cdm_session_renew_key_.Record(1.0, NO_ERROR);
session_metrics.cdm_session_restore_offline_session_.Increment(NO_ERROR, session_metrics.cdm_session_restore_offline_session_.Increment(
UNKNOWN_ERROR); NO_ERROR, DeviceFiles::ResponseType::kObjectNotInitialized);
session_metrics.cdm_session_restore_usage_session_.Increment(NO_ERROR, session_metrics.cdm_session_restore_usage_session_.Increment(
UNKNOWN_ERROR); NO_ERROR, DeviceFiles::ResponseType::kObjectNotInitialized);
session_metrics.cdm_session_license_request_latency_ms_.Record( session_metrics.cdm_session_license_request_latency_ms_.Record(
2.0, kKeyRequestTypeInitial); 2.0, kKeyRequestTypeInitial);

View File

@@ -239,7 +239,7 @@ CdmResponseType WvContentDecryptionModule::GetUsageInfo(
const std::string& app_id, const CdmIdentifier& identifier, const std::string& app_id, const CdmIdentifier& identifier,
CdmUsageInfo* usage_info) { CdmUsageInfo* usage_info) {
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier); CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
CdmResponseType error_detail = NO_ERROR; int error_detail = NO_ERROR;
return cdm_engine->GetUsageInfo(app_id, &error_detail, usage_info); return cdm_engine->GetUsageInfo(app_id, &error_detail, usage_info);
} }
@@ -247,7 +247,7 @@ CdmResponseType WvContentDecryptionModule::GetUsageInfo(
const std::string& app_id, const CdmSecureStopId& ssid, const std::string& app_id, const CdmSecureStopId& ssid,
const CdmIdentifier& identifier, CdmUsageInfo* usage_info) { const CdmIdentifier& identifier, CdmUsageInfo* usage_info) {
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier); CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
CdmResponseType error_detail = NO_ERROR; int error_detail = NO_ERROR;
return cdm_engine->GetUsageInfo(app_id, ssid, &error_detail, usage_info); return cdm_engine->GetUsageInfo(app_id, ssid, &error_detail, usage_info);
} }