Use mediadrm from private instead of tangorpro
* Private mediadrm: ag/29478046, ag/29489024 Bug: 367906184 Bug: 366426322 Flag: EXEMPT castauth enabled Test: b/367906184#comment5 Change-Id: I8dc459ca757de0efd0e989adf92dcb0f4bf5519d
This commit is contained in:
parent
70a2a32350
commit
25046bedc2
15 changed files with 0 additions and 988 deletions
|
@ -1,39 +0,0 @@
|
|||
#include "SessionLibrary.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
namespace castkeydrm {
|
||||
|
||||
std::mutex SessionLibrary::singleton_lock_;
|
||||
SessionLibrary* SessionLibrary::singleton_ = NULL;
|
||||
|
||||
SessionLibrary* SessionLibrary::get() {
|
||||
std::lock_guard<std::mutex> guard(singleton_lock_);
|
||||
|
||||
if (singleton_ == NULL) {
|
||||
singleton_ = new SessionLibrary();
|
||||
}
|
||||
|
||||
return singleton_;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> SessionLibrary::createSession() {
|
||||
std::lock_guard<std::mutex> guard(session_lock_);
|
||||
|
||||
std::string session_string = std::to_string(next_session_id_);
|
||||
next_session_id_ += 1;
|
||||
sessions_.emplace_back(session_string.begin(), session_string.end());
|
||||
return sessions_.back();
|
||||
}
|
||||
|
||||
void SessionLibrary::closeSession(const std::vector<uint8_t>& session) {
|
||||
std::lock_guard<std::mutex> guard(session_lock_);
|
||||
sessions_.erase(std::remove_if(sessions_.begin(), sessions_.end(),
|
||||
[&session](const std::vector<uint8_t>& e) {
|
||||
return std::equal(e.begin(), e.end(), session.begin());
|
||||
}),
|
||||
sessions_.end());
|
||||
}
|
||||
|
||||
} // namespace castkeydrm
|
Loading…
Add table
Add a link
Reference in a new issue