Merge "Use String8/16 c_str [cas]" into main am: f23e19a533

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2705833

Change-Id: I1b8dc5d5ae6e2c3b1f11afabc46ad7bb167935fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Tomasz Wasilczyk
2023-08-30 10:26:04 +00:00
committed by Automerger Merge Worker
16 changed files with 36 additions and 40 deletions

View File

@@ -103,8 +103,7 @@ Return<void> CasImpl::openSession(openSession_cb _hidl_cb) {
Return<Status> CasImpl::setSessionPrivateData(
const HidlCasSessionId &sessionId, const HidlCasData& pvtData) {
ALOGV("%s: sessionId=%s", __FUNCTION__,
sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -113,8 +112,7 @@ Return<Status> CasImpl::setSessionPrivateData(
}
Return<Status> CasImpl::closeSession(const HidlCasSessionId &sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__,
sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -124,8 +122,7 @@ Return<Status> CasImpl::closeSession(const HidlCasSessionId &sessionId) {
Return<Status> CasImpl::processEcm(
const HidlCasSessionId &sessionId, const HidlCasData& ecm) {
ALOGV("%s: sessionId=%s", __FUNCTION__,
sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);

View File

@@ -62,8 +62,7 @@ DescramblerImpl::~DescramblerImpl() {
}
Return<Status> DescramblerImpl::setMediaCasSession(const HidlCasSessionId& sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__,
sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<DescramblerPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {

View File

@@ -98,10 +98,10 @@ bool FactoryLoader<T>::findFactoryForScheme(
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -138,10 +138,10 @@ bool FactoryLoader<T>::enumeratePlugins(
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}

View File

@@ -29,7 +29,7 @@ namespace V1_0 {
namespace implementation {
SharedLibrary::SharedLibrary(const String8 &path) {
mLibHandle = dlopen(path.string(), RTLD_NOW);
mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {

View File

@@ -125,7 +125,7 @@ Return<void> CasImpl::openSession(openSession_cb _hidl_cb) {
Return<Status> CasImpl::setSessionPrivateData(const HidlCasSessionId& sessionId,
const HidlCasData& pvtData) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -134,7 +134,7 @@ Return<Status> CasImpl::setSessionPrivateData(const HidlCasSessionId& sessionId,
}
Return<Status> CasImpl::closeSession(const HidlCasSessionId& sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -143,7 +143,7 @@ Return<Status> CasImpl::closeSession(const HidlCasSessionId& sessionId) {
}
Return<Status> CasImpl::processEcm(const HidlCasSessionId& sessionId, const HidlCasData& ecm) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);

View File

@@ -59,7 +59,7 @@ DescramblerImpl::~DescramblerImpl() {
}
Return<Status> DescramblerImpl::setMediaCasSession(const HidlCasSessionId& sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<DescramblerPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {

View File

@@ -90,10 +90,10 @@ bool FactoryLoader<T>::findFactoryForScheme(int32_t CA_system_id, sp<SharedLibra
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -127,10 +127,10 @@ bool FactoryLoader<T>::enumeratePlugins(vector<HidlCasPluginDescriptor>* results
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}

View File

@@ -29,7 +29,7 @@ namespace V1_1 {
namespace implementation {
SharedLibrary::SharedLibrary(const String8& path) {
mLibHandle = dlopen(path.string(), RTLD_NOW);
mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {

View File

@@ -174,7 +174,7 @@ Return<void> CasImpl::openSession_1_2(const SessionIntent intent, const Scrambli
Return<Status> CasImpl::setSessionPrivateData(const HidlCasSessionId& sessionId,
const HidlCasData& pvtData) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -183,7 +183,7 @@ Return<Status> CasImpl::setSessionPrivateData(const HidlCasSessionId& sessionId,
}
Return<Status> CasImpl::closeSession(const HidlCasSessionId& sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -192,7 +192,7 @@ Return<Status> CasImpl::closeSession(const HidlCasSessionId& sessionId) {
}
Return<Status> CasImpl::processEcm(const HidlCasSessionId& sessionId, const HidlCasData& ecm) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);

View File

@@ -59,7 +59,7 @@ DescramblerImpl::~DescramblerImpl() {
}
Return<Status> DescramblerImpl::setMediaCasSession(const HidlCasSessionId& sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<DescramblerPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {

View File

@@ -90,10 +90,10 @@ bool FactoryLoader<T>::findFactoryForScheme(int32_t CA_system_id, sp<SharedLibra
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -127,10 +127,10 @@ bool FactoryLoader<T>::enumeratePlugins(vector<HidlCasPluginDescriptor>* results
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}

View File

@@ -29,7 +29,7 @@ namespace V1_1 {
namespace implementation {
SharedLibrary::SharedLibrary(const String8& path) {
mLibHandle = dlopen(path.string(), RTLD_NOW);
mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {

View File

@@ -158,7 +158,7 @@ ScopedAStatus CasImpl::openSession(SessionIntent intent, ScramblingMode mode,
ScopedAStatus CasImpl::setSessionPrivateData(const vector<uint8_t>& sessionId,
const vector<uint8_t>& pvtData) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
shared_ptr<CasPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -167,7 +167,7 @@ ScopedAStatus CasImpl::setSessionPrivateData(const vector<uint8_t>& sessionId,
}
ScopedAStatus CasImpl::closeSession(const vector<uint8_t>& sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
shared_ptr<CasPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -176,7 +176,7 @@ ScopedAStatus CasImpl::closeSession(const vector<uint8_t>& sessionId) {
}
ScopedAStatus CasImpl::processEcm(const vector<uint8_t>& sessionId, const vector<uint8_t>& ecm) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
shared_ptr<CasPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);

View File

@@ -54,7 +54,7 @@ DescramblerImpl::~DescramblerImpl() {
}
ScopedAStatus DescramblerImpl::setMediaCasSession(const vector<uint8_t>& in_sessionId) {
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(in_sessionId).string());
ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(in_sessionId).c_str());
shared_ptr<DescramblerPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {

View File

@@ -87,10 +87,10 @@ bool FactoryLoader<T>::findFactoryForScheme(int32_t CA_system_id,
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -124,10 +124,10 @@ bool FactoryLoader<T>::enumeratePlugins(vector<AidlCasPluginDescriptor>* results
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
DIR* pDir = opendir(dirPath.string());
DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
ALOGE("Failed to open plugin directory %s", dirPath.string());
ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}

View File

@@ -26,7 +26,7 @@ namespace hardware {
namespace cas {
SharedLibrary::SharedLibrary(const String8& path) {
mLibHandle = dlopen(path.string(), RTLD_NOW);
mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {