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

Commit e449b0c1 authored by Ruchir Rastogi's avatar Ruchir Rastogi
Browse files

Move statsd (and tests) to libbinder_ndk

Major changes include:
    - Removing unused permission checks within StatsService. These
      include ENFORCE_DUMP_AND_USAGE_STATS, checkDumpAndUsageStats,
      kOpUsage, and kPermissionUsage.
    - Converting from sp to shared_ptr
    - Using libbinder_ndk functions instead of libbinder functions
      (e.g. for installing death recipients, getting calling uids, etc.)
        - New death recipients were added in StatsService,
          ConfigManager, and SubscriberReporter.
    - Using a unique token (timestamp) to identify shell subscribers
      instead of IResultReceiver because IResultReceiver is not exposed by
      libbinder_ndk. Currently, statsd cannot detect if perfd dies; we
      will fix that later.

Bug: 145232107
Bug: 148609603
Test: m statsd
Test: m statsd_test
Test: bit stastd_test:*
Test: atest GtsStatsdHostTestCases
Change-Id: Ia1fda7280c22320bc4ebc8371acaadbe8eabcbd2
parent 22b21595
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,11 +123,11 @@ cc_defaults {
        "libutils",
    ],
    shared_libs: [
        "libbinder",
        "libbinder_ndk",
        "libincident",
        "liblog",
        "libstatssocket",
        "statsd-aidl-cpp",
        "statsd-aidl-ndk_platform",
    ],
}

+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ namespace statsd {

using std::string;
using std::vector;
using android::base::StringPrintf;

// These constants must be kept in sync with those in StatsDimensionsValue.java
const static int STATS_DIMENSIONS_VALUE_STRING_TYPE = 2;
@@ -73,7 +74,7 @@ static void populateStatsDimensionsValueParcelChildren(StatsDimensionsValueParce
                    break;
                case STRING:
                    childParcel.valueType = STATS_DIMENSIONS_VALUE_STRING_TYPE;
                    childParcel.stringValue = String16(dim.mValue.str_value.c_str());
                    childParcel.stringValue = dim.mValue.str_value;
                    break;
                default:
                    ALOGE("Encountered FieldValue with unsupported value type.");
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

#pragma once

#include <android/os/StatsDimensionsValueParcel.h>
#include <aidl/android/os/StatsDimensionsValueParcel.h>
#include <utils/JenkinsHash.h>
#include <vector>
#include "android-base/stringprintf.h"
@@ -27,7 +27,7 @@ namespace android {
namespace os {
namespace statsd {

using android::base::StringPrintf;
using ::aidl::android::os::StatsDimensionsValueParcel;

struct Metric2Condition {
    int64_t conditionId;
Loading