Merge "Remove apex_available from libstatslog" into rvc-dev

This commit is contained in:
Jeffrey Huang
2020-03-11 05:26:32 +00:00
committed by Android (Google) Code Review
13 changed files with 77 additions and 49 deletions

View File

@@ -113,8 +113,8 @@ cc_defaults {
"libbase", "libbase",
"libcutils", "libcutils",
"libprotoutil", "libprotoutil",
"libstatslog",
"libstatsmetadata", "libstatsmetadata",
"libstatslog_statsd",
"libsysutils", "libsysutils",
"libutils", "libutils",
], ],
@@ -171,6 +171,37 @@ cc_library_static {
], ],
} }
genrule {
name: "statslog_statsd.h",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_statsd.h --module statsd --namespace android,os,statsd,util",
out: [
"statslog_statsd.h",
],
}
genrule {
name: "statslog_statsd.cpp",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_statsd.cpp --module statsd --namespace android,os,statsd,util --importHeader statslog_statsd.h",
out: [
"statslog_statsd.cpp",
],
}
cc_library_static {
name: "libstatslog_statsd",
generated_sources: ["statslog_statsd.cpp"],
generated_headers: ["statslog_statsd.h"],
export_generated_headers: ["statslog_statsd.h"],
apex_available: [
"com.android.os.statsd",
"test_com.android.os.statsd",
],
shared_libs: [
"libstatssocket",
]
}
// ========= // =========
// statsd // statsd
@@ -300,6 +331,7 @@ cc_test {
static_libs: [ static_libs: [
"libgmock", "libgmock",
"libplatformprotos", "libplatformprotos",
"libstatslog", //TODO(b/150976524): remove this when the tests no longer hardcode atoms.
"libstatssocket_private", "libstatssocket_private",
], ],

View File

@@ -34,7 +34,7 @@
#include "state/StateManager.h" #include "state/StateManager.h"
#include "stats_log_util.h" #include "stats_log_util.h"
#include "stats_util.h" #include "stats_util.h"
#include "statslog.h" #include "statslog_statsd.h"
#include "storage/StorageManager.h" #include "storage/StorageManager.h"
using namespace android; using namespace android;
@@ -287,17 +287,17 @@ void StatsLogProcessor::getAndUpdateTrainInfoOnDisk(bool is_rollback,
int64_t firstId = trainInfo->experimentIds.at(0); int64_t firstId = trainInfo->experimentIds.at(0);
auto& ids = trainInfo->experimentIds; auto& ids = trainInfo->experimentIds;
switch (trainInfo->status) { switch (trainInfo->status) {
case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALL_SUCCESS: case android::os::statsd::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALL_SUCCESS:
if (find(ids.begin(), ids.end(), firstId + 1) == ids.end()) { if (find(ids.begin(), ids.end(), firstId + 1) == ids.end()) {
ids.push_back(firstId + 1); ids.push_back(firstId + 1);
} }
break; break;
case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_INITIATED: case android::os::statsd::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_INITIATED:
if (find(ids.begin(), ids.end(), firstId + 2) == ids.end()) { if (find(ids.begin(), ids.end(), firstId + 2) == ids.end()) {
ids.push_back(firstId + 2); ids.push_back(firstId + 2);
} }
break; break;
case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_SUCCESS: case android::os::statsd::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_SUCCESS:
if (find(ids.begin(), ids.end(), firstId + 3) == ids.end()) { if (find(ids.begin(), ids.end(), firstId + 3) == ids.end()) {
ids.push_back(firstId + 3); ids.push_back(firstId + 3);
} }
@@ -366,13 +366,13 @@ vector<int64_t> StatsLogProcessor::processWatchdogRollbackOccurred(const int32_t
int64_t firstId = trainInfoOnDisk.experimentIds[0]; int64_t firstId = trainInfoOnDisk.experimentIds[0];
auto& ids = trainInfoOnDisk.experimentIds; auto& ids = trainInfoOnDisk.experimentIds;
switch (rollbackTypeIn) { switch (rollbackTypeIn) {
case android::util::WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_TYPE__ROLLBACK_INITIATE: case android::os::statsd::util::WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_TYPE__ROLLBACK_INITIATE:
if (find(ids.begin(), ids.end(), firstId + 4) == ids.end()) { if (find(ids.begin(), ids.end(), firstId + 4) == ids.end()) {
ids.push_back(firstId + 4); ids.push_back(firstId + 4);
} }
StorageManager::writeTrainInfo(trainInfoOnDisk); StorageManager::writeTrainInfo(trainInfoOnDisk);
break; break;
case android::util::WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_TYPE__ROLLBACK_SUCCESS: case android::os::statsd::util::WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_TYPE__ROLLBACK_SUCCESS:
if (find(ids.begin(), ids.end(), firstId + 5) == ids.end()) { if (find(ids.begin(), ids.end(), firstId + 5) == ids.end()) {
ids.push_back(firstId + 5); ids.push_back(firstId + 5);
} }
@@ -405,13 +405,13 @@ void StatsLogProcessor::OnLogEvent(LogEvent* event, int64_t elapsedRealtimeNs) {
// Hard-coded logic to update train info on disk and fill in any information // Hard-coded logic to update train info on disk and fill in any information
// this log event may be missing. // this log event may be missing.
if (event->GetTagId() == android::util::BINARY_PUSH_STATE_CHANGED) { if (event->GetTagId() == android::os::statsd::util::BINARY_PUSH_STATE_CHANGED) {
onBinaryPushStateChangedEventLocked(event); onBinaryPushStateChangedEventLocked(event);
} }
// Hard-coded logic to update experiment ids on disk for certain rollback // Hard-coded logic to update experiment ids on disk for certain rollback
// types and fill the rollback atom with experiment ids // types and fill the rollback atom with experiment ids
if (event->GetTagId() == android::util::WATCHDOG_ROLLBACK_OCCURRED) { if (event->GetTagId() == android::os::statsd::util::WATCHDOG_ROLLBACK_OCCURRED) {
onWatchdogRollbackOccurredLocked(event); onWatchdogRollbackOccurredLocked(event);
} }
@@ -429,7 +429,7 @@ void StatsLogProcessor::OnLogEvent(LogEvent* event, int64_t elapsedRealtimeNs) {
// Hard-coded logic to update the isolated uid's in the uid-map. // Hard-coded logic to update the isolated uid's in the uid-map.
// The field numbers need to be currently updated by hand with atoms.proto // The field numbers need to be currently updated by hand with atoms.proto
if (event->GetTagId() == android::util::ISOLATED_UID_CHANGED) { if (event->GetTagId() == android::os::statsd::util::ISOLATED_UID_CHANGED) {
onIsolatedUidChangedEventLocked(*event); onIsolatedUidChangedEventLocked(*event);
} }
@@ -446,7 +446,7 @@ void StatsLogProcessor::OnLogEvent(LogEvent* event, int64_t elapsedRealtimeNs) {
} }
if (event->GetTagId() != android::util::ISOLATED_UID_CHANGED) { if (event->GetTagId() != android::os::statsd::util::ISOLATED_UID_CHANGED) {
// Map the isolated uid to host uid if necessary. // Map the isolated uid to host uid if necessary.
mapIsolatedUidToHostUidIfNecessaryLocked(event); mapIsolatedUidToHostUidIfNecessaryLocked(event);
} }

View File

@@ -32,7 +32,7 @@
#include <frameworks/base/cmds/statsd/src/statsd_config.pb.h> #include <frameworks/base/cmds/statsd/src/statsd_config.pb.h>
#include <frameworks/base/cmds/statsd/src/uid_data.pb.h> #include <frameworks/base/cmds/statsd/src/uid_data.pb.h>
#include <private/android_filesystem_config.h> #include <private/android_filesystem_config.h>
#include <statslog.h> #include <statslog_statsd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/system_properties.h> #include <sys/system_properties.h>
@@ -767,7 +767,8 @@ status_t StatsService::cmd_log_app_breadcrumb(int out, const Vector<String8>& ar
} }
if (good) { if (good) {
dprintf(out, "Logging AppBreadcrumbReported(%d, %d, %d) to statslog.\n", uid, label, state); dprintf(out, "Logging AppBreadcrumbReported(%d, %d, %d) to statslog.\n", uid, label, state);
android::util::stats_write(android::util::APP_BREADCRUMB_REPORTED, uid, label, state); android::os::statsd::util::stats_write(
android::os::statsd::util::APP_BREADCRUMB_REPORTED, uid, label, state);
} else { } else {
print_cmd_help(out); print_cmd_help(out);
return UNKNOWN_ERROR; return UNKNOWN_ERROR;
@@ -1188,7 +1189,7 @@ Status StatsService::unsetBroadcastSubscriber(int64_t configId,
Status StatsService::sendAppBreadcrumbAtom(int32_t label, int32_t state) { Status StatsService::sendAppBreadcrumbAtom(int32_t label, int32_t state) {
// Permission check not necessary as it's meant for applications to write to // Permission check not necessary as it's meant for applications to write to
// statsd. // statsd.
android::util::stats_write(util::APP_BREADCRUMB_REPORTED, android::os::statsd::util::stats_write(android::os::statsd::util::APP_BREADCRUMB_REPORTED,
(int32_t) AIBinder_getCallingUid(), label, (int32_t) AIBinder_getCallingUid(), label,
state); state);
return Status::ok(); return Status::ok();

View File

@@ -23,7 +23,6 @@
#include "stats_util.h" #include "stats_util.h"
#include "storage/StorageManager.h" #include "storage/StorageManager.h"
#include <statslog.h>
#include <time.h> #include <time.h>
namespace android { namespace android {

View File

@@ -25,7 +25,7 @@
#include "subscriber/SubscriberReporter.h" #include "subscriber/SubscriberReporter.h"
#include <inttypes.h> #include <inttypes.h>
#include <statslog.h> #include <statslog_statsd.h>
#include <time.h> #include <time.h>
namespace android { namespace android {
@@ -235,8 +235,8 @@ void AnomalyTracker::declareAnomaly(const int64_t& timestampNs, int64_t metricId
StatsdStats::getInstance().noteAnomalyDeclared(mConfigKey, mAlert.id()); StatsdStats::getInstance().noteAnomalyDeclared(mConfigKey, mAlert.id());
// TODO(b/110564268): This should also take in the const MetricDimensionKey& key? // TODO(b/110564268): This should also take in the const MetricDimensionKey& key?
android::util::stats_write(android::util::ANOMALY_DETECTED, mConfigKey.GetUid(), util::stats_write(util::ANOMALY_DETECTED, mConfigKey.GetUid(),
mConfigKey.GetId(), mAlert.id()); mConfigKey.GetId(), mAlert.id());
} }
void AnomalyTracker::detectAndDeclareAnomaly(const int64_t& timestampNs, void AnomalyTracker::detectAndDeclareAnomaly(const int64_t& timestampNs,

View File

@@ -122,10 +122,10 @@ message Atom {
SettingChanged setting_changed = 41 [(module) = "framework"]; SettingChanged setting_changed = 41 [(module) = "framework"];
ActivityForegroundStateChanged activity_foreground_state_changed = ActivityForegroundStateChanged activity_foreground_state_changed =
42 [(module) = "framework"]; 42 [(module) = "framework"];
IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework"]; IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework", (module) = "statsd"];
PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"]; PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"]; WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
AnomalyDetected anomaly_detected = 46; AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
AppBreadcrumbReported app_breadcrumb_reported = AppBreadcrumbReported app_breadcrumb_reported =
47 [(allow_from_any_uid) = true, (module) = "statsd"]; 47 [(allow_from_any_uid) = true, (module) = "statsd"];
AppStartOccurred app_start_occurred = 48 [(module) = "framework"]; AppStartOccurred app_start_occurred = 48 [(module) = "framework"];
@@ -138,7 +138,7 @@ message Atom {
AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"]; AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"]; ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
BootSequenceReported boot_sequence_reported = 57; BootSequenceReported boot_sequence_reported = 57;
DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true]; DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"]; OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"];
ForegroundServiceStateChanged foreground_service_state_changed ForegroundServiceStateChanged foreground_service_state_changed
= 60 [(module) = "framework"]; = 60 [(module) = "framework"];
@@ -166,7 +166,7 @@ message Atom {
LowMemReported low_mem_reported = 81 [(module) = "framework"]; LowMemReported low_mem_reported = 81 [(module) = "framework"];
GenericAtom generic_atom = 82; GenericAtom generic_atom = 82;
KeyValuePairsAtom key_value_pairs_atom = KeyValuePairsAtom key_value_pairs_atom =
83 [(allow_from_any_uid) = true, (module) = "framework"]; 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"]; VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"]; DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true]; ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
@@ -242,7 +242,8 @@ message Atom {
AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"]; AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
SpeechDspStatReported speech_dsp_stat_reported = 145; SpeechDspStatReported speech_dsp_stat_reported = 145;
UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"]; UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
WatchdogRollbackOccurred watchdog_rollback_occurred = 147 [(module) = "framework"]; WatchdogRollbackOccurred watchdog_rollback_occurred =
147 [(module) = "framework", (module) = "statsd"];
BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
148 [(module) = "framework"]; 148 [(module) = "framework"];
BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"]; BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
@@ -412,7 +413,8 @@ message Atom {
SubsystemSleepState subsystem_sleep_state = 10005; SubsystemSleepState subsystem_sleep_state = 10005;
CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"]; CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"]; CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"]; CpuTimePerUidFreq cpu_time_per_uid_freq =
10010 [(module) = "framework", (module) = "statsd"];
WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"]; WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"]; ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"]; BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
@@ -425,9 +427,9 @@ message Atom {
RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"]; RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"]; FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Temperature temperature = 10021 [(module) = "framework"]; Temperature temperature = 10021 [(module) = "framework"];
BinderCalls binder_calls = 10022 [(module) = "framework"]; BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"]; BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
LooperStats looper_stats = 10024 [(module) = "framework"]; LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
DiskStats disk_stats = 10025 [(module) = "framework"]; DiskStats disk_stats = 10025 [(module) = "framework"];
DirectoryUsage directory_usage = 10026 [(module) = "framework"]; DirectoryUsage directory_usage = 10026 [(module) = "framework"];
AppSize app_size = 10027 [(module) = "framework"]; AppSize app_size = 10027 [(module) = "framework"];
@@ -455,7 +457,7 @@ message Atom {
NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"]; NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
RoleHolder role_holder = 10049 [(module) = "framework"]; RoleHolder role_holder = 10049 [(module) = "framework"];
DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"]; DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
TrainInfo train_info = 10051; TrainInfo train_info = 10051 [(module) = "statsd"];
TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"]; TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"]; ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
GpuStatsGlobalInfo gpu_stats_global_info = 10054; GpuStatsGlobalInfo gpu_stats_global_info = 10054;

View File

@@ -32,7 +32,7 @@
#include "../statscompanion_util.h" #include "../statscompanion_util.h"
#include "StatsCallbackPuller.h" #include "StatsCallbackPuller.h"
#include "TrainInfoPuller.h" #include "TrainInfoPuller.h"
#include "statslog.h" #include "statslog_statsd.h"
using std::shared_ptr; using std::shared_ptr;
using std::vector; using std::vector;
@@ -47,7 +47,7 @@ const int64_t NO_ALARM_UPDATE = INT64_MAX;
StatsPullerManager::StatsPullerManager() StatsPullerManager::StatsPullerManager()
: kAllPullAtomInfo({ : kAllPullAtomInfo({
// TrainInfo. // TrainInfo.
{{.atomTag = android::util::TRAIN_INFO}, new TrainInfoPuller()}, {{.atomTag = util::TRAIN_INFO}, new TrainInfoPuller()},
}), }),
mNextPullTimeNs(NO_ALARM_UPDATE) { mNextPullTimeNs(NO_ALARM_UPDATE) {
} }

View File

@@ -22,7 +22,7 @@
#include "TrainInfoPuller.h" #include "TrainInfoPuller.h"
#include "logd/LogEvent.h" #include "logd/LogEvent.h"
#include "stats_log_util.h" #include "stats_log_util.h"
#include "statslog.h" #include "statslog_statsd.h"
#include "storage/StorageManager.h" #include "storage/StorageManager.h"
using std::make_shared; using std::make_shared;
@@ -33,7 +33,7 @@ namespace os {
namespace statsd { namespace statsd {
TrainInfoPuller::TrainInfoPuller() : TrainInfoPuller::TrainInfoPuller() :
StatsPuller(android::util::TRAIN_INFO) { StatsPuller(util::TRAIN_INFO) {
} }
bool TrainInfoPuller::PullInternal(vector<shared_ptr<LogEvent>>* data) { bool TrainInfoPuller::PullInternal(vector<shared_ptr<LogEvent>>* data) {

View File

@@ -20,7 +20,7 @@
#include <android/util/ProtoOutputStream.h> #include <android/util/ProtoOutputStream.h>
#include "../stats_log_util.h" #include "../stats_log_util.h"
#include "statslog.h" #include "statslog_statsd.h"
#include "storage/StorageManager.h" #include "storage/StorageManager.h"
namespace android { namespace android {
@@ -113,9 +113,9 @@ const int FIELD_ID_ACTIVATION_BROADCAST_GUARDRAIL_UID = 1;
const int FIELD_ID_ACTIVATION_BROADCAST_GUARDRAIL_TIME = 2; const int FIELD_ID_ACTIVATION_BROADCAST_GUARDRAIL_TIME = 2;
const std::map<int, std::pair<size_t, size_t>> StatsdStats::kAtomDimensionKeySizeLimitMap = { const std::map<int, std::pair<size_t, size_t>> StatsdStats::kAtomDimensionKeySizeLimitMap = {
{android::util::BINDER_CALLS, {6000, 10000}}, {util::BINDER_CALLS, {6000, 10000}},
{android::util::LOOPER_STATS, {1500, 2500}}, {util::LOOPER_STATS, {1500, 2500}},
{android::util::CPU_TIME_PER_UID_FREQ, {6000, 10000}}, {util::CPU_TIME_PER_UID_FREQ, {6000, 10000}},
}; };
StatsdStats::StatsdStats() { StatsdStats::StatsdStats() {

View File

@@ -18,7 +18,7 @@
#include "logd/LogEvent.h" #include "logd/LogEvent.h"
#include "stats_log_util.h" #include "stats_log_util.h"
#include "statslog.h" #include "statslog_statsd.h"
#include <android/binder_ibinder.h> #include <android/binder_ibinder.h>
#include <android-base/stringprintf.h> #include <android-base/stringprintf.h>
@@ -100,7 +100,7 @@ LogEvent::LogEvent(int32_t tagId, int64_t wallClockTimestampNs, int64_t elapsedT
const std::map<int32_t, float>& float_map) { const std::map<int32_t, float>& float_map) {
mLogdTimestampNs = wallClockTimestampNs; mLogdTimestampNs = wallClockTimestampNs;
mElapsedTimestampNs = elapsedTimestampNs; mElapsedTimestampNs = elapsedTimestampNs;
mTagId = android::util::KEY_VALUE_PAIRS_ATOM; mTagId = util::KEY_VALUE_PAIRS_ATOM;
mLogUid = uid; mLogUid = uid;
int pos[] = {1, 1, 1}; int pos[] = {1, 1, 1};
@@ -153,7 +153,7 @@ LogEvent::LogEvent(const string& trainName, int64_t trainVersionCode, bool requi
const std::vector<uint8_t>& experimentIds, int32_t userId) { const std::vector<uint8_t>& experimentIds, int32_t userId) {
mLogdTimestampNs = getWallClockNs(); mLogdTimestampNs = getWallClockNs();
mElapsedTimestampNs = getElapsedRealtimeNs(); mElapsedTimestampNs = getElapsedRealtimeNs();
mTagId = android::util::BINARY_PUSH_STATE_CHANGED; mTagId = util::BINARY_PUSH_STATE_CHANGED;
mLogUid = AIBinder_getCallingUid(); mLogUid = AIBinder_getCallingUid();
mLogPid = AIBinder_getCallingPid(); mLogPid = AIBinder_getCallingPid();
@@ -172,7 +172,7 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
const InstallTrainInfo& trainInfo) { const InstallTrainInfo& trainInfo) {
mLogdTimestampNs = wallClockTimestampNs; mLogdTimestampNs = wallClockTimestampNs;
mElapsedTimestampNs = elapsedTimestampNs; mElapsedTimestampNs = elapsedTimestampNs;
mTagId = android::util::TRAIN_INFO; mTagId = util::TRAIN_INFO;
mValues.push_back( mValues.push_back(
FieldValue(Field(mTagId, getSimpleField(1)), Value(trainInfo.trainVersionCode))); FieldValue(Field(mTagId, getSimpleField(1)), Value(trainInfo.trainVersionCode)));

View File

@@ -31,7 +31,7 @@
#include "state/StateManager.h" #include "state/StateManager.h"
#include "stats_log_util.h" #include "stats_log_util.h"
#include "stats_util.h" #include "stats_util.h"
#include "statslog.h" #include "statslog_statsd.h"
using android::util::FIELD_COUNT_REPEATED; using android::util::FIELD_COUNT_REPEATED;
using android::util::FIELD_TYPE_INT32; using android::util::FIELD_TYPE_INT32;
@@ -291,7 +291,7 @@ bool MetricsManager::checkLogCredentials(const LogEvent& event) {
} }
bool MetricsManager::eventSanityCheck(const LogEvent& event) { bool MetricsManager::eventSanityCheck(const LogEvent& event) {
if (event.GetTagId() == android::util::APP_BREADCRUMB_REPORTED) { if (event.GetTagId() == util::APP_BREADCRUMB_REPORTED) {
// Check that app breadcrumb reported fields are valid. // Check that app breadcrumb reported fields are valid.
status_t err = NO_ERROR; status_t err = NO_ERROR;
@@ -318,7 +318,7 @@ bool MetricsManager::eventSanityCheck(const LogEvent& event) {
VLOG("APP_BREADCRUMB_REPORTED does not have valid state %ld", appHookState); VLOG("APP_BREADCRUMB_REPORTED does not have valid state %ld", appHookState);
return false; return false;
} }
} else if (event.GetTagId() == android::util::DAVEY_OCCURRED) { } else if (event.GetTagId() == util::DAVEY_OCCURRED) {
// Daveys can be logged from any app since they are logged in libs/hwui/JankTracker.cpp. // Daveys can be logged from any app since they are logged in libs/hwui/JankTracker.cpp.
// Check that the davey duration is reasonable. Max length check is for privacy. // Check that the davey duration is reasonable. Max length check is for privacy.
status_t err = NO_ERROR; status_t err = NO_ERROR;

View File

@@ -139,7 +139,7 @@ public:
// record is deleted. // record is deleted.
void appendUidMap(const int64_t& timestamp, const ConfigKey& key, std::set<string>* str_set, void appendUidMap(const int64_t& timestamp, const ConfigKey& key, std::set<string>* str_set,
bool includeVersionStrings, bool includeInstaller, bool includeVersionStrings, bool includeInstaller,
util::ProtoOutputStream* proto); ProtoOutputStream* proto);
// Forces the output to be cleared. We still generate a snapshot based on the current state. // Forces the output to be cleared. We still generate a snapshot based on the current state.
// This results in extra data uploaded but helps us reconstruct the uid mapping on the server // This results in extra data uploaded but helps us reconstruct the uid mapping on the server

View File

@@ -120,12 +120,6 @@ cc_library {
"liblog", "liblog",
"libcutils", "libcutils",
], ],
apex_available: [
"//apex_available:platform",
//TODO(b/149781190): Remove this once statsd no longer depends on libstatslog
"com.android.os.statsd",
"test_com.android.os.statsd",
],
target: { target: {
android: { android: {
shared_libs: ["libstatssocket"], shared_libs: ["libstatssocket"],