diff options
author | 2023-08-11 00:06:51 +0000 | |
---|---|---|
committer | 2023-08-25 16:54:51 +0000 | |
commit | 0bfea2dd184de2263d655632bdbcda4553b2ed56 (patch) | |
tree | 937bf1291811a88ea1693d927f2af21ac4b2831b /libs/binder/IServiceManager.cpp | |
parent | d2c95f8c7a125e3cc522454e41f380ebfdfdc574 (diff) |
Use String8/16 c_str [binder]
Current String8::string() has two problems: it may suggest it's
returning a std::string and also prevents a drop-in replacement
with std::string.
Bug: 295394788
Test: make checkbuild
Change-Id: I1eb6ddebe3faede57f3e6f046da572a79056125a
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r-- | libs/binder/IServiceManager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index 2408307459..6034f2b4ca 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -216,8 +216,8 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid, bool logP if (res) { if (startTime != 0) { ALOGI("Check passed after %d seconds for %s from uid=%d pid=%d", - (int)((uptimeMillis()-startTime)/1000), - String8(permission).string(), uid, pid); + (int)((uptimeMillis() - startTime) / 1000), String8(permission).c_str(), + uid, pid); } return res; } @@ -225,7 +225,7 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid, bool logP // Is this a permission failure, or did the controller go away? if (IInterface::asBinder(pc)->isBinderAlive()) { if (logPermissionFailure) { - ALOGW("Permission failure: %s from uid=%d pid=%d", String8(permission).string(), + ALOGW("Permission failure: %s from uid=%d pid=%d", String8(permission).c_str(), uid, pid); } return false; @@ -246,7 +246,7 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid, bool logP if (startTime == 0) { startTime = uptimeMillis(); ALOGI("Waiting to check permission %s from uid=%d pid=%d", - String8(permission).string(), uid, pid); + String8(permission).c_str(), uid, pid); } sleep(1); } else { @@ -295,7 +295,7 @@ sp<IBinder> ServiceManagerShim::getService(const String16& name) const // retry interval in millisecond; note that vendor services stay at 100ms const useconds_t sleepTime = gSystemBootCompleted ? 1000 : 100; - ALOGI("Waiting for service '%s' on '%s'...", String8(name).string(), + ALOGI("Waiting for service '%s' on '%s'...", String8(name).c_str(), ProcessState::self()->getDriverName().c_str()); int n = 0; @@ -306,12 +306,12 @@ sp<IBinder> ServiceManagerShim::getService(const String16& name) const sp<IBinder> svc = checkService(name); if (svc != nullptr) { ALOGI("Waiting for service '%s' on '%s' successful after waiting %" PRIi64 "ms", - String8(name).string(), ProcessState::self()->getDriverName().c_str(), + String8(name).c_str(), ProcessState::self()->getDriverName().c_str(), uptimeMillis() - startTime); return svc; } } - ALOGW("Service %s didn't start. Returning NULL", String8(name).string()); + ALOGW("Service %s didn't start. Returning NULL", String8(name).c_str()); return nullptr; } |