Revert "Merge latest oemcrypto-v17 change"
This reverts commit 642965c678.
Reason for revert: Droidfood Blocking Bug: 217145027
Change-Id: I669b72fcd91c62e28883b5f55eb36af274d85806
(cherry picked from commit 8dbea15e5da05b371572297041454569dc166c90)
Merged-In:I669b72fcd91c62e28883b5f55eb36af274d85806
This commit is contained in:
committed by
Android Build Coastguard Worker
parent
1397b61f87
commit
d69b488be1
@@ -13,7 +13,7 @@
|
||||
// This type alias is for convenience.
|
||||
using CdmRandomLock = std::unique_lock<std::mutex>;
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
|
||||
namespace {
|
||||
// More information about C++11's random number generators can be found
|
||||
@@ -77,10 +77,10 @@ std::string CdmRandomGenerator::RandomData(size_t length) {
|
||||
return std::string();
|
||||
}
|
||||
CdmRandomLock lock(generator_lock_);
|
||||
std::uniform_int_distribution<short> dist(0, 255); // Range of [0, 255].
|
||||
std::uniform_int_distribution<uint8_t> dist; // Range of [0, 255].
|
||||
std::string random_data(length, '\0');
|
||||
std::generate(random_data.begin(), random_data.end(),
|
||||
[&]() { return static_cast<char>(dist(generator_)); });
|
||||
[&]() { return dist(generator_); });
|
||||
return random_data;
|
||||
}
|
||||
|
||||
@@ -104,4 +104,4 @@ CdmRandomGenerator* CdmRandom::GetInstance() {
|
||||
return g_instance;
|
||||
}
|
||||
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
|
||||
int64_t Clock::GetCurrentTime() {
|
||||
struct timeval tv;
|
||||
@@ -17,4 +17,4 @@ int64_t Clock::GetCurrentTime() {
|
||||
return tv.tv_sec;
|
||||
}
|
||||
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "file_utils.h"
|
||||
#include "log.h"
|
||||
#include "string_conversions.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
|
||||
#include <openssl/md5.h>
|
||||
|
||||
@@ -27,7 +28,7 @@
|
||||
// to strerror_r(3).
|
||||
#define ERRORSTR_BUF_SIZE 1024
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
namespace {
|
||||
// Maximum number of attempts to read or write on a file.
|
||||
constexpr size_t kMaxIoAttempts = 5;
|
||||
@@ -41,8 +42,6 @@ constexpr int kClosedFd = -1;
|
||||
// handling code to enter a bad state.
|
||||
constexpr int kNoError = 0;
|
||||
|
||||
constexpr char kEmptyOrigin[] = "";
|
||||
|
||||
// Reads from file specified by |fd| into the provided |buffer| up to
|
||||
// the number of bytes specified by |count|.
|
||||
// This is an internal function and assumes that all parameters are
|
||||
@@ -283,7 +282,7 @@ std::string GetFileNameSafeHash(const std::string& input) {
|
||||
std::vector<uint8_t> hash(MD5_DIGEST_LENGTH);
|
||||
MD5(reinterpret_cast<const uint8_t*>(input.data()), input.size(),
|
||||
hash.data());
|
||||
return wvutil::Base64SafeEncode(hash);
|
||||
return wvcdm::Base64SafeEncode(hash);
|
||||
}
|
||||
|
||||
std::string GetFileNameForIdentifier(const std::string path,
|
||||
@@ -426,7 +425,7 @@ class AndroidFile : public File {
|
||||
|
||||
class FileSystem::Impl {};
|
||||
|
||||
FileSystem::FileSystem() : FileSystem(kEmptyOrigin, nullptr) {}
|
||||
FileSystem::FileSystem() : FileSystem(EMPTY_ORIGIN, nullptr) {}
|
||||
FileSystem::FileSystem(const std::string& origin, void* /* extra_data */)
|
||||
: origin_(origin) {}
|
||||
|
||||
@@ -529,4 +528,4 @@ void FileSystem::set_origin(const std::string& origin) { origin_ = origin; }
|
||||
void FileSystem::set_identifier(const std::string& identifier) {
|
||||
identifier_ = identifier;
|
||||
}
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "file_store.h"
|
||||
#include "log.h"
|
||||
#include "properties.h"
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
|
||||
bool IsCurrentOrParentDirectory(const char* dir) {
|
||||
return strcmp(dir, kCurrentDirectory) == 0 ||
|
||||
@@ -226,4 +228,4 @@ bool FileUtils::CreateDirectory(const std::string& path_in) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
// #define LOG_NDEBUG 0
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
|
||||
namespace {
|
||||
int64_t GetCurrentTimeMs() {
|
||||
@@ -141,4 +141,4 @@ std::vector<LogMessage> LogBuffer::getLogs() {
|
||||
return {buffer_.begin(), buffer_.end()};
|
||||
}
|
||||
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "log.h"
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
|
||||
shared_mutex::~shared_mutex() {
|
||||
if (reader_count_ > 0) {
|
||||
@@ -57,4 +57,4 @@ void shared_mutex::unlock() {
|
||||
condition_variable_.notify_all();
|
||||
}
|
||||
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "log.h"
|
||||
#include "platform.h"
|
||||
|
||||
namespace wvutil {
|
||||
namespace wvcdm {
|
||||
namespace {
|
||||
// Base64 character set, indexed for their 6-bit mapping, plus '='.
|
||||
const char kBase64Codes[] =
|
||||
@@ -326,4 +326,4 @@ std::string EncodeUint32(unsigned int u) {
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace wvutil
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user