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

Commit 12930acc authored by Luca Stefani's avatar Luca Stefani
Browse files

Merge tag 'android-9.0.0_r31' into lineage-16.0-android-9.0.0_r31

Android 9.0.0 Release 31 (PQ2A.190205.001)

* tag 'android-9.0.0_r31': (212 commits)
  Bluetooth: Check descriptors size in BluetoothHidDeviceAppSdpSettings
  RESTRICT AUTOMERGE: Added an app id security check in isAppForeground.
  Change types of fields of network stats reported to framework.
  Fix negative uid stats caused by 464xlat adjust when eBPF is on.
  DO NOT MERGE Fix the icon overlay after density change
  docs: Removing @see link to hidden field
  docs: Fixing typos.
  Select only preinstalled Spell Checker Services
  Import translations. DO NOT MERGE
  Change types of fields of network stats reported to framework.
  Import translations. DO NOT MERGE
  RESTRICT AUTOMERGE: Disable separated emergency button
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  ...

Change-Id: Ifc797a30b839ec56ac6321dfa7c22e323c74cef1
parents 38919152 eb71e821
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ const int FIELD_ID_STRINGS = 9;

#define STATS_DATA_DIR "/data/misc/stats-data"

// Cool down period for writing data to disk to avoid overwriting files.
#define WRITE_DATA_COOL_DOWN_SEC 5

StatsLogProcessor::StatsLogProcessor(const sp<UidMap>& uidMap,
                                     const sp<AlarmMonitor>& anomalyAlarmMonitor,
                                     const sp<AlarmMonitor>& periodicAlarmMonitor,
@@ -526,6 +529,16 @@ void StatsLogProcessor::WriteDataToDiskLocked(const ConfigKey& key,

void StatsLogProcessor::WriteDataToDiskLocked(const DumpReportReason dumpReportReason) {
    const int64_t timeNs = getElapsedRealtimeNs();
    // Do not write to disk if we already have in the last few seconds.
    // This is to avoid overwriting files that would have the same name if we
    //   write twice in the same second.
    if (static_cast<unsigned long long> (timeNs) <
            mLastWriteTimeNs + WRITE_DATA_COOL_DOWN_SEC * NS_PER_SEC) {
        ALOGI("Statsd skipping writing data to disk. Already wrote data in last %d seconds",
                WRITE_DATA_COOL_DOWN_SEC);
        return;
    }
    mLastWriteTimeNs = timeNs;
    for (auto& pair : mMetricsManagers) {
        WriteDataToDiskLocked(pair.first, timeNs, dumpReportReason);
    }
+5 −1
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@ enum DumpReportReason {
    GET_DATA_CALLED = 4,
    ADB_DUMP = 5,
    CONFIG_RESET = 6,
    STATSCOMPANION_DIED = 7
    STATSCOMPANION_DIED = 7,
    TERMINATION_SIGNAL_RECEIVED = 8
};

class StatsLogProcessor : public ConfigListener {
@@ -183,6 +184,9 @@ private:

    long mLastPullerCacheClearTimeSec = 0;

    // Last time we wrote data to disk.
    int64_t mLastWriteTimeNs = 0;

#ifdef VERY_VERBOSE_PRINTING
    bool mPrintAllLogs = false;
#endif
+7 −0
Original line number Diff line number Diff line
@@ -881,6 +881,13 @@ void StatsService::Startup() {
    mConfigManager->Startup();
}

void StatsService::Terminate() {
    ALOGI("StatsService::Terminating");
    if (mProcessor != nullptr) {
        mProcessor->WriteDataToDisk(TERMINATION_SIGNAL_RECEIVED);
    }
}

void StatsService::OnLogEvent(LogEvent* event, bool reconnectionStarts) {
    mProcessor->OnLogEvent(event, reconnectionStarts);
}
+5 −0
Original line number Diff line number Diff line
@@ -73,6 +73,11 @@ public:
     */
    void Startup();

    /**
     * Called when terminiation signal received.
     */
    void Terminate();

    /**
     * Called by LogReader when there's a log event to process.
     */
+21 −2
Original line number Diff line number Diff line
@@ -121,8 +121,7 @@ message Atom {
        ANROccurred anr_occurred = 79;
        WTFOccurred wtf_occurred = 80;
        LowMemReported low_mem_reported = 81;


        ThermalThrottlingStateChanged thermal_throttling = 86;
    }

    // Pulled events will start at field 10000.
@@ -197,6 +196,26 @@ message AttributionNode {
 * *****************************************************************************
 */

/**
 * Logs when the Thermal service HAL notifies the throttling start/stop events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
 */
message ThermalThrottlingStateChanged {
    optional android.os.TemperatureTypeEnum sensor_type = 1;

    enum State {
        UNKNOWN = 0;
        START = 1;
        STOP = 2;
    }

    optional State state = 2;

    optional float temperature = 3;
}

/**
 * Logs when the screen state changes.
 *
Loading