Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13378dd0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "fix the permission check crash in statsd."

parents 3674b322 7ee94150
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -575,9 +575,7 @@ void StatsService::OnLogEvent(const LogEvent& event) {

Status StatsService::getData(const String16& key, vector<uint8_t>* output) {
    IPCThreadState* ipc = IPCThreadState::self();
    if (checkCallingPermission(String16(kPermissionDump),
                               reinterpret_cast<int32_t*>(ipc->getCallingPid()),
                               reinterpret_cast<int32_t*>(ipc->getCallingUid()))) {
    if (checkCallingPermission(String16(kPermissionDump))) {
        // TODO: Implement this.
        return Status::ok();
    } else {
@@ -591,8 +589,7 @@ Status StatsService::addConfiguration(const String16& key,
                                      bool* success) {
    IPCThreadState* ipc = IPCThreadState::self();
    int32_t* uid = reinterpret_cast<int32_t*>(ipc->getCallingUid());
    if (checkCallingPermission(String16(kPermissionDump),
                               reinterpret_cast<int32_t*>(ipc->getCallingPid()), uid)) {
    if (checkCallingPermission(String16(kPermissionDump))) {
        string keyString = string(String8(key).string());
        ConfigKey configKey(*uid, keyString);
        StatsdConfig cfg;
@@ -609,9 +606,7 @@ Status StatsService::addConfiguration(const String16& key,

Status StatsService::removeConfiguration(const String16& key, bool* success) {
    IPCThreadState* ipc = IPCThreadState::self();
    if (checkCallingPermission(String16(kPermissionDump),
                               reinterpret_cast<int32_t*>(ipc->getCallingPid()),
                               reinterpret_cast<int32_t*>(ipc->getCallingUid()))) {
    if (checkCallingPermission(String16(kPermissionDump))) {
        // TODO: Implement this.
        return Status::ok();
    } else {
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ void ConfigManager::Startup() {
    readConfigFromDisk();

    // this should be called from StatsService when it receives a statsd_config
    UpdateConfig(ConfigKey(0, "fake"), build_fake_config());
    UpdateConfig(ConfigKey(1000, "fake"), build_fake_config());
}

void ConfigManager::AddListener(const sp<ConfigListener>& listener) {