summaryrefslogtreecommitdiff
path: root/cmds/incidentd/src/IncidentService.cpp
diff options
context:
space:
mode:
authorWenjie Zhou <zhouwenjie@google.com>2020-05-15 02:06:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-15 02:06:30 +0000
commitad24e49e2f8ab44c9a89a4a22dac4180a8355fdd (patch)
treed1ab4519801698f2a3b34f5d0fc26a0c66b40275 /cmds/incidentd/src/IncidentService.cpp
parent103aed340e289e28a1d72f332d1504d328601d99 (diff)
parent751c7c947a2f6c4a080f5a6b8b1fa9846999edbe (diff)
Merge "mCallback defined in BringYourOwnSection should be an object instead of a reference." into rvc-dev
Diffstat (limited to 'cmds/incidentd/src/IncidentService.cpp')
-rw-r--r--cmds/incidentd/src/IncidentService.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmds/incidentd/src/IncidentService.cpp b/cmds/incidentd/src/IncidentService.cpp
index 9e6d0a23de10..dc1612575f38 100644
--- a/cmds/incidentd/src/IncidentService.cpp
+++ b/cmds/incidentd/src/IncidentService.cpp
@@ -351,9 +351,9 @@ Status IncidentService::reportIncidentToDumpstate(unique_fd stream,
Status IncidentService::registerSection(const int id, const String16& name16,
const sp<IIncidentDumpCallback>& callback) {
- const char* name = String8(name16).c_str();
+ const String8 name = String8(name16);
const uid_t callingUid = IPCThreadState::self()->getCallingUid();
- ALOGI("Uid %d registers section %d '%s'", callingUid, id, name);
+ ALOGI("Uid %d registers section %d '%s'", callingUid, id, name.c_str());
if (callback == nullptr) {
return Status::fromExceptionCode(Status::EX_NULL_POINTER);
}
@@ -363,11 +363,11 @@ Status IncidentService::registerSection(const int id, const String16& name16,
ALOGW("Error registering section %d: calling uid does not match", id);
return Status::fromExceptionCode(Status::EX_SECURITY);
}
- mRegisteredSections.at(i) = new BringYourOwnSection(id, name, callingUid, callback);
+ mRegisteredSections.at(i) = new BringYourOwnSection(id, name.c_str(), callingUid, callback);
return Status::ok();
}
}
- mRegisteredSections.push_back(new BringYourOwnSection(id, name, callingUid, callback));
+ mRegisteredSections.push_back(new BringYourOwnSection(id, name.c_str(), callingUid, callback));
return Status::ok();
}