Use String8/16 c_str [media]
Bug: 295394788
Test: make checkbuild
Change-Id: I4ba5400f39c769bec59508525844f1daefe1d15c
diff --git a/services/mediaresourcemanager/ResourceManagerService.cpp b/services/mediaresourcemanager/ResourceManagerService.cpp
index f718406..9c81f89 100644
--- a/services/mediaresourcemanager/ResourceManagerService.cpp
+++ b/services/mediaresourcemanager/ResourceManagerService.cpp
@@ -164,7 +164,7 @@
static String8 getString(const std::vector<T>& items) {
String8 itemsStr;
for (size_t i = 0; i < items.size(); ++i) {
- itemsStr.appendFormat("%s ", toString(items[i]).string());
+ itemsStr.appendFormat("%s ", toString(items[i]).c_str());
}
return itemsStr;
}
@@ -272,7 +272,7 @@
"can't dump ResourceManagerService from pid=%d, uid=%d\n",
AIBinder_getCallingPid(),
AIBinder_getCallingUid());
- write(fd, result.string(), result.size());
+ write(fd, result.c_str(), result.size());
return PERMISSION_DENIED;
}
@@ -325,7 +325,7 @@
const ResourceList& resources = info.resources;
result.append(" Resources:\n");
for (auto it = resources.begin(); it != resources.end(); it++) {
- snprintf(buffer, SIZE, " %s\n", toString(it->second).string());
+ snprintf(buffer, SIZE, " %s\n", toString(it->second).c_str());
result.append(buffer);
}
}
@@ -339,7 +339,7 @@
result.append(" Events logs (most recent at top):\n");
result.append(serviceLog);
- write(fd, result.string(), result.size());
+ write(fd, result.c_str(), result.size());
return OK;
}
@@ -417,7 +417,7 @@
}
Status ResourceManagerService::config(const std::vector<MediaResourcePolicyParcel>& policies) {
- String8 log = String8::format("config(%s)", getString(policies).string());
+ String8 log = String8::format("config(%s)", getString(policies).c_str());
mServiceLog->add(log);
std::scoped_lock lock{mLock};
@@ -490,7 +490,7 @@
int64_t clientId = clientInfo.id;
const std::string& name = clientInfo.name;
String8 log = String8::format("addResource(pid %d, uid %d clientId %lld, resources %s)",
- pid, uid, (long long) clientId, getString(resources).string());
+ pid, uid, (long long) clientId, getString(resources).c_str());
mServiceLog->add(log);
std::scoped_lock lock{mLock};
@@ -552,7 +552,7 @@
int32_t uid = clientInfo.uid;
int64_t clientId = clientInfo.id;
String8 log = String8::format("removeResource(pid %d, uid %d clientId %lld, resources %s)",
- pid, uid, (long long) clientId, getString(resources).string());
+ pid, uid, (long long) clientId, getString(resources).c_str());
mServiceLog->add(log);
std::scoped_lock lock{mLock};
@@ -679,7 +679,7 @@
int32_t callingPid = clientInfo.pid;
std::string clientName = clientInfo.name;
String8 log = String8::format("reclaimResource(callingPid %d, uid %d resources %s)",
- callingPid, clientInfo.uid, getString(resources).string());
+ callingPid, clientInfo.uid, getString(resources).c_str());
mServiceLog->add(log);
*_aidl_return = false;