Merge changes I295f66f9,I142f286c into rvc-dev am: 05fbb3dd87 am: 0db9b974c2 am: 1c6633d408 am: 7b0fe07c8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11620164 Change-Id: If47d215914fbb11d2d33cd01b635d4fe16112957
This commit is contained in:
@@ -71,6 +71,7 @@ using video_widevine_client::sdk::
|
||||
|
||||
namespace {
|
||||
|
||||
const char kAtscCertificateFileName[] = "atsccert.bin";
|
||||
const char kCertificateFileName[] = "cert.bin";
|
||||
const char kHlsAttributesFileNameExt[] = ".hal";
|
||||
const char kUsageInfoFileNamePrefix[] = "usage";
|
||||
@@ -127,19 +128,21 @@ bool DeviceFiles::StoreCertificate(const std::string& certificate,
|
||||
std::string serialized_file;
|
||||
file.SerializeToString(&serialized_file);
|
||||
|
||||
return StoreFileWithHash(GetCertificateFileName(), serialized_file) ==
|
||||
return StoreFileWithHash(GetCertificateFileName(false), serialized_file) ==
|
||||
kNoError;
|
||||
}
|
||||
|
||||
bool DeviceFiles::RetrieveCertificate(std::string* certificate,
|
||||
bool DeviceFiles::RetrieveCertificate(bool atsc_mode_enabled,
|
||||
std::string* certificate,
|
||||
std::string* wrapped_private_key,
|
||||
std::string* serial_number,
|
||||
uint32_t* system_id) {
|
||||
RETURN_FALSE_IF_UNINITIALIZED();
|
||||
|
||||
video_widevine_client::sdk::File file;
|
||||
if (RetrieveHashedFile(GetCertificateFileName(), &file) != kNoError) {
|
||||
LOGE("Unable to retrieve certificate file");
|
||||
if (RetrieveHashedFile(GetCertificateFileName(atsc_mode_enabled), &file) !=
|
||||
kNoError) {
|
||||
LOGW("Unable to retrieve certificate file");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -167,14 +170,16 @@ bool DeviceFiles::RetrieveCertificate(std::string* certificate,
|
||||
device_certificate.certificate(), serial_number, system_id);
|
||||
}
|
||||
|
||||
bool DeviceFiles::HasCertificate() {
|
||||
bool DeviceFiles::HasCertificate(bool atsc_mode_enabled) {
|
||||
RETURN_FALSE_IF_UNINITIALIZED();
|
||||
return FileExists(GetCertificateFileName());
|
||||
|
||||
return FileExists(GetCertificateFileName(atsc_mode_enabled));
|
||||
}
|
||||
|
||||
bool DeviceFiles::RemoveCertificate() {
|
||||
RETURN_FALSE_IF_UNINITIALIZED()
|
||||
return RemoveFile(GetCertificateFileName());
|
||||
|
||||
return RemoveFile(GetCertificateFileName(false));
|
||||
}
|
||||
|
||||
bool DeviceFiles::StoreLicense(const CdmLicenseData& license_data,
|
||||
@@ -1215,8 +1220,8 @@ ssize_t DeviceFiles::GetFileSize(const std::string& name) {
|
||||
return file_system_->FileSize(path);
|
||||
}
|
||||
|
||||
std::string DeviceFiles::GetCertificateFileName() {
|
||||
return kCertificateFileName;
|
||||
std::string DeviceFiles::GetCertificateFileName(bool atsc_mode_enabled) {
|
||||
return atsc_mode_enabled ? kAtscCertificateFileName : kCertificateFileName;
|
||||
}
|
||||
|
||||
std::string DeviceFiles::GetUsageTableFileName() { return kUsageTableFileName; }
|
||||
|
||||
Reference in New Issue
Block a user