diff options
author | Muhammad Qureshi <muhammadq@google.com> | 2020-06-18 18:28:21 -0700 |
---|---|---|
committer | Muhammad Qureshi <muhammadq@google.com> | 2020-06-18 18:59:12 -0700 |
commit | 741d31898aee02855220cfd3a1492dd287e4d212 (patch) | |
tree | 19523b503a903197c722cfe986f629a101d47a88 /cmds | |
parent | 19272a236b0b6de53a330af745f5b5500ecc95d0 (diff) |
Remove libstatsmetadata
Remove kWhitelistedAtoms usage in MetricsManager and remove:
- atoms_info references from statsd
- libstatsmetadata usages from statsd
- libstatsmetadata library
- atoms_info_writer.h/.cpp
- references to atoms_info in rest of stats-log-api-gen
- allow_from_any_uid annotation
Fixes: 147600720
Fixes: 154856835
Fixes: 148993016
Test: m stats-log-api-gen
Test: m stats-log-api-gen-test &&
out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test
Test: m statsd
Change-Id: I2e0579609ff257da934b95cdda397f3ca0ffa1f0
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/statsd/Android.bp | 46 | ||||
-rw-r--r-- | cmds/statsd/src/atom_field_options.proto | 2 | ||||
-rw-r--r-- | cmds/statsd/src/atoms.proto | 12 | ||||
-rw-r--r-- | cmds/statsd/src/metrics/MetricsManager.cpp | 8 |
4 files changed, 5 insertions, 63 deletions
diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp index 3dbe41395024..0617eb6c0e66 100644 --- a/cmds/statsd/Android.bp +++ b/cmds/statsd/Android.bp @@ -116,7 +116,6 @@ cc_defaults { "libcutils", "libgtest_prod", "libprotoutil", - "libstatsmetadata", "libstatslog_statsd", "libsysutils", "libutils", @@ -129,51 +128,6 @@ cc_defaults { ], } -// ================ -// libstatsmetadata -// ================ - -genrule { - name: "atoms_info.h", - tools: ["stats-log-api-gen"], - cmd: "$(location stats-log-api-gen) --atomsInfoHeader $(genDir)/atoms_info.h", - out: [ - "atoms_info.h", - ], -} - -genrule { - name: "atoms_info.cpp", - tools: ["stats-log-api-gen"], - cmd: "$(location stats-log-api-gen) --atomsInfoCpp $(genDir)/atoms_info.cpp", - out: [ - "atoms_info.cpp", - ], -} - -cc_library_static { - name: "libstatsmetadata", - host_supported: true, - generated_sources: [ - "atoms_info.cpp", - ], - generated_headers: [ - "atoms_info.h", - ], - cflags: [ - "-Wall", - "-Werror", - ], - export_generated_headers: [ - "atoms_info.h", - ], - apex_available: [ - //TODO(b/149782403): Remove this once statsd no longer links against libstatsmetadata - "com.android.os.statsd", - "test_com.android.os.statsd", - ], -} - genrule { name: "statslog_statsd.h", tools: ["stats-log-api-gen"], diff --git a/cmds/statsd/src/atom_field_options.proto b/cmds/statsd/src/atom_field_options.proto index 8527185d3891..ff5717e4fa78 100644 --- a/cmds/statsd/src/atom_field_options.proto +++ b/cmds/statsd/src/atom_field_options.proto @@ -110,8 +110,6 @@ extend google.protobuf.FieldOptions { optional LogMode log_mode = 50002 [default = MODE_AUTOMATIC]; - optional bool allow_from_any_uid = 50003 [default = false]; - repeated string module = 50004; optional bool truncate_timestamp = 50005 [default = false]; diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index dc20a02156cb..7a4c3b1c38d2 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -145,8 +145,7 @@ message Atom { PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"]; WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"]; AnomalyDetected anomaly_detected = 46 [(module) = "statsd"]; - AppBreadcrumbReported app_breadcrumb_reported = - 47 [(allow_from_any_uid) = true, (module) = "statsd"]; + AppBreadcrumbReported app_breadcrumb_reported = 47 [(module) = "statsd"]; AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"]; AppStartCanceled app_start_canceled = 49 [(module) = "framework"]; AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"]; @@ -157,7 +156,7 @@ message Atom { AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"]; ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"]; BootSequenceReported boot_sequence_reported = 57; - DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"]; + DaveyOccurred davey_occurred = 58 [(module) = "statsd"]; OverlayStateChanged overlay_state_changed = 59 [(module) = "framework", (module) = "statsdtest"]; ForegroundServiceStateChanged foreground_service_state_changed @@ -186,8 +185,7 @@ message Atom { WTFOccurred wtf_occurred = 80 [(module) = "framework"]; LowMemReported low_mem_reported = 81 [(module) = "framework"]; GenericAtom generic_atom = 82; - KeyValuePairsAtom key_value_pairs_atom = - 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"]; + KeyValuePairsAtom key_value_pairs_atom = 83 [(module) = "framework", (module) = "statsd"]; VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"]; DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"]; ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true]; @@ -317,7 +315,7 @@ message Atom { AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"]; AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"]; TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"]; - HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"]; + HiddenApiUsed hidden_api_used = 178 [(module) = "framework"]; StyleUIChanged style_ui_changed = 179 [(module) = "sysui"]; PrivacyIndicatorsInteracted privacy_indicators_interacted = 180 [(module) = "permissioncontroller"]; @@ -383,7 +381,7 @@ message Atom { UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226; CameraActionEvent camera_action_event = 227 [(module) = "framework"]; AppCompatibilityChangeReported app_compatibility_change_reported = - 228 [(allow_from_any_uid) = true, (module) = "framework"]; + 228 [(module) = "framework"]; PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"]; VmsClientConnectionStateChanged vms_client_connection_state_changed = 230 [(module) = "car"]; diff --git a/cmds/statsd/src/metrics/MetricsManager.cpp b/cmds/statsd/src/metrics/MetricsManager.cpp index 7e825efddb75..60de1a24cce5 100644 --- a/cmds/statsd/src/metrics/MetricsManager.cpp +++ b/cmds/statsd/src/metrics/MetricsManager.cpp @@ -21,7 +21,6 @@ #include <private/android_filesystem_config.h> #include "CountMetricProducer.h" -#include "atoms_info.h" #include "condition/CombinationConditionTracker.h" #include "condition/SimpleConditionTracker.h" #include "guardrail/StatsdStats.h" @@ -372,13 +371,6 @@ void MetricsManager::onDumpReport(const int64_t dumpTimeStampNs, bool MetricsManager::checkLogCredentials(const LogEvent& event) { - // TODO(b/154856835): Remove this check once we get whitelist from the config. - if (android::util::AtomsInfo::kWhitelistedAtoms.find(event.GetTagId()) != - android::util::AtomsInfo::kWhitelistedAtoms.end()) - { - return true; - } - if (mWhitelistedAtomIds.find(event.GetTagId()) != mWhitelistedAtomIds.end()) { return true; } |