Convert statsd and incidentd to Android.bp
See build/soong/README.md for more information.
Fixes: 110563449
Test: m checkbuild
Change-Id: I8c80878cec46c9299234c6f4c1e0e19efc0a221e
diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp
index 94203f4f..02dde5a 100644
--- a/cmds/statsd/Android.bp
+++ b/cmds/statsd/Android.bp
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2015 The Android Open Source Project
+// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -42,6 +42,277 @@
}
+cc_defaults {
+ name: "statsd_defaults",
+ aidl: {
+ include_dirs: ["frameworks/base/core/java"],
+ },
+
+ srcs: [
+ ":statsd_aidl",
+ "src/statsd_config.proto",
+ "src/FieldValue.cpp",
+ "src/hash.cpp",
+ "src/stats_log_util.cpp",
+ "src/anomaly/AlarmMonitor.cpp",
+ "src/anomaly/AlarmTracker.cpp",
+ "src/anomaly/AnomalyTracker.cpp",
+ "src/anomaly/DurationAnomalyTracker.cpp",
+ "src/anomaly/subscriber_util.cpp",
+ "src/condition/CombinationConditionTracker.cpp",
+ "src/condition/condition_util.cpp",
+ "src/condition/SimpleConditionTracker.cpp",
+ "src/condition/ConditionWizard.cpp",
+ "src/condition/StateTracker.cpp",
+ "src/config/ConfigKey.cpp",
+ "src/config/ConfigListener.cpp",
+ "src/config/ConfigManager.cpp",
+ "src/external/Perfetto.cpp",
+ "src/external/Perfprofd.cpp",
+ "src/external/StatsPuller.cpp",
+ "src/external/StatsCompanionServicePuller.cpp",
+ "src/external/SubsystemSleepStatePuller.cpp",
+ "src/external/ResourceHealthManagerPuller.cpp",
+ "src/external/ResourceThermalManagerPuller.cpp",
+ "src/external/StatsPullerManager.cpp",
+ "src/external/puller_util.cpp",
+ "src/logd/LogEvent.cpp",
+ "src/logd/LogListener.cpp",
+ "src/matchers/CombinationLogMatchingTracker.cpp",
+ "src/matchers/EventMatcherWizard.cpp",
+ "src/matchers/matcher_util.cpp",
+ "src/matchers/SimpleLogMatchingTracker.cpp",
+ "src/metrics/MetricProducer.cpp",
+ "src/metrics/EventMetricProducer.cpp",
+ "src/metrics/CountMetricProducer.cpp",
+ "src/metrics/DurationMetricProducer.cpp",
+ "src/metrics/duration_helper/OringDurationTracker.cpp",
+ "src/metrics/duration_helper/MaxDurationTracker.cpp",
+ "src/metrics/ValueMetricProducer.cpp",
+ "src/metrics/GaugeMetricProducer.cpp",
+ "src/metrics/MetricsManager.cpp",
+ "src/metrics/metrics_manager_util.cpp",
+ "src/packages/UidMap.cpp",
+ "src/storage/StorageManager.cpp",
+ "src/StatsLogProcessor.cpp",
+ "src/StatsService.cpp",
+ "src/statscompanion_util.cpp",
+ "src/subscriber/IncidentdReporter.cpp",
+ "src/subscriber/SubscriberReporter.cpp",
+ "src/HashableDimensionKey.cpp",
+ "src/guardrail/StatsdStats.cpp",
+ "src/socket/StatsSocketListener.cpp",
+ "src/shell/ShellSubscriber.cpp",
+ "src/shell/shell_config.proto",
+
+ ":perfprofd_aidl",
+ ],
+
+ local_include_dirs: [
+ "src",
+ ],
+
+ static_libs: [
+ "libhealthhalutils",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libbinder",
+ "libincident",
+ "liblog",
+ "libutils",
+ "libservices",
+ "libprotoutil",
+ "libstatslog",
+ "libhardware",
+ "libhardware_legacy",
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "android.frameworks.stats@1.0",
+ "android.hardware.health@2.0",
+ "android.hardware.power@1.0",
+ "android.hardware.power@1.1",
+ "android.hardware.thermal@1.0",
+ "libpackagelistparser",
+ "libsysutils",
+ "libcutils",
+ ],
+}
+
+// =========
+// statsd
+// =========
+
+cc_binary {
+ name: "statsd",
+ defaults: ["statsd_defaults"],
+
+ srcs: ["src/main.cpp"],
+
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ "-Wno-unused-parameter",
+ // optimize for size (protobuf glop can get big)
+ "-Os",
+ // "-g",
+ // "-O0",
+ ],
+
+ product_variables: {
+ eng: {
+ // Enable sanitizer ONLY on eng builds
+ //sanitize: {
+ // address: true,
+ //},
+ },
+ debuggable: {
+ // Add a flag to enable stats log printing from statsd on debug builds.
+ cflags: ["-DVERY_VERBOSE_PRINTING"],
+ },
+ },
+
+ proto: {
+ type: "lite",
+ },
+
+ shared_libs: ["libgtest_prod"],
+
+ init_rc: ["statsd.rc"],
+}
+
+// ==============
+// statsd_test
+// ==============
+
+cc_test {
+ name: "statsd_test",
+ defaults: ["statsd_defaults"],
+ test_suites: ["device-tests"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-missing-field-initializers",
+ "-Wno-unused-variable",
+ "-Wno-unused-function",
+ "-Wno-unused-parameter",
+ ],
+
+ srcs: [
+ "src/atom_field_options.proto",
+ "src/atoms.proto",
+ "src/stats_log.proto",
+ "src/shell/shell_data.proto",
+ "tests/AlarmMonitor_test.cpp",
+ "tests/anomaly/AlarmTracker_test.cpp",
+ "tests/anomaly/AnomalyTracker_test.cpp",
+ "tests/ConfigManager_test.cpp",
+ "tests/external/puller_util_test.cpp",
+ "tests/indexed_priority_queue_test.cpp",
+ "tests/LogEntryMatcher_test.cpp",
+ "tests/LogEvent_test.cpp",
+ "tests/MetricsManager_test.cpp",
+ "tests/StatsLogProcessor_test.cpp",
+ "tests/StatsService_test.cpp",
+ "tests/UidMap_test.cpp",
+ "tests/FieldValue_test.cpp",
+ "tests/condition/CombinationConditionTracker_test.cpp",
+ "tests/condition/SimpleConditionTracker_test.cpp",
+ "tests/condition/StateTracker_test.cpp",
+ "tests/metrics/OringDurationTracker_test.cpp",
+ "tests/metrics/MaxDurationTracker_test.cpp",
+ "tests/metrics/CountMetricProducer_test.cpp",
+ "tests/metrics/DurationMetricProducer_test.cpp",
+ "tests/metrics/EventMetricProducer_test.cpp",
+ "tests/metrics/ValueMetricProducer_test.cpp",
+ "tests/metrics/GaugeMetricProducer_test.cpp",
+ "tests/guardrail/StatsdStats_test.cpp",
+ "tests/metrics/metrics_test_helper.cpp",
+ "tests/statsd_test_util.cpp",
+ "tests/e2e/WakelockDuration_e2e_test.cpp",
+ "tests/e2e/MetricActivation_e2e_test.cpp",
+ "tests/e2e/MetricConditionLink_e2e_test.cpp",
+ "tests/e2e/Alarm_e2e_test.cpp",
+ "tests/e2e/Attribution_e2e_test.cpp",
+ "tests/e2e/GaugeMetric_e2e_push_test.cpp",
+ "tests/e2e/GaugeMetric_e2e_pull_test.cpp",
+ "tests/e2e/ValueMetric_pull_e2e_test.cpp",
+ "tests/e2e/DimensionInCondition_e2e_combination_AND_cond_test.cpp",
+ "tests/e2e/DimensionInCondition_e2e_combination_OR_cond_test.cpp",
+ "tests/e2e/DimensionInCondition_e2e_simple_cond_test.cpp",
+ "tests/e2e/Anomaly_count_e2e_test.cpp",
+ "tests/e2e/Anomaly_duration_sum_e2e_test.cpp",
+ "tests/e2e/ConfigTtl_e2e_test.cpp",
+ "tests/e2e/PartialBucket_e2e_test.cpp",
+ "tests/shell/ShellSubscriber_test.cpp",
+ ],
+
+ static_libs: [
+ "libgmock",
+ "libplatformprotos",
+ ],
+
+ proto: {
+ type: "full",
+ include_dirs: ["external/protobuf/src"],
+ },
+
+ shared_libs: ["libprotobuf-cpp-full"],
+
+}
+
+//#############################
+// statsd micro benchmark
+//#############################
+
+cc_benchmark {
+ name: "statsd_benchmark",
+ defaults: ["statsd_defaults"],
+
+ srcs: [
+ "src/atom_field_options.proto",
+ "src/atoms.proto",
+ "src/stats_log.proto",
+ "benchmark/main.cpp",
+ "benchmark/hello_world_benchmark.cpp",
+ "benchmark/log_event_benchmark.cpp",
+ "benchmark/stats_write_benchmark.cpp",
+ "benchmark/filter_value_benchmark.cpp",
+ "benchmark/get_dimensions_for_condition_benchmark.cpp",
+ "benchmark/metric_util.cpp",
+ "benchmark/duration_metric_benchmark.cpp",
+ ],
+
+ proto: {
+ type: "full",
+ include_dirs: ["external/protobuf/src"],
+ },
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ "-Wno-unused-variable",
+ "-Wno-unused-function",
+
+ // Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
+ "-Wno-varargs"
+ ],
+
+ static_libs: [
+ "libplatformprotos",
+ ],
+
+ shared_libs: [
+ "libgtest_prod",
+ "libstatslog",
+ "libprotobuf-cpp-full",
+ ],
+}
// ==== java proto device library (for test only) ==============================
java_library {
diff --git a/cmds/statsd/Android.mk b/cmds/statsd/Android.mk
deleted file mode 100644
index 5818f5d..0000000
--- a/cmds/statsd/Android.mk
+++ /dev/null
@@ -1,319 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-
-statsd_common_src := \
- ../../core/java/android/os/IStatsCompanionService.aidl \
- ../../core/java/android/os/IStatsManager.aidl \
- src/statsd_config.proto \
- src/FieldValue.cpp \
- src/hash.cpp \
- src/stats_log_util.cpp \
- src/anomaly/AlarmMonitor.cpp \
- src/anomaly/AlarmTracker.cpp \
- src/anomaly/AnomalyTracker.cpp \
- src/anomaly/DurationAnomalyTracker.cpp \
- src/anomaly/subscriber_util.cpp \
- src/condition/CombinationConditionTracker.cpp \
- src/condition/condition_util.cpp \
- src/condition/SimpleConditionTracker.cpp \
- src/condition/ConditionWizard.cpp \
- src/condition/StateTracker.cpp \
- src/config/ConfigKey.cpp \
- src/config/ConfigListener.cpp \
- src/config/ConfigManager.cpp \
- src/external/Perfetto.cpp \
- src/external/Perfprofd.cpp \
- src/external/StatsPuller.cpp \
- src/external/StatsCompanionServicePuller.cpp \
- src/external/SubsystemSleepStatePuller.cpp \
- src/external/ResourceHealthManagerPuller.cpp \
- src/external/ResourceThermalManagerPuller.cpp \
- src/external/StatsPullerManager.cpp \
- src/external/puller_util.cpp \
- src/logd/LogEvent.cpp \
- src/logd/LogListener.cpp \
- src/matchers/CombinationLogMatchingTracker.cpp \
- src/matchers/EventMatcherWizard.cpp \
- src/matchers/matcher_util.cpp \
- src/matchers/SimpleLogMatchingTracker.cpp \
- src/metrics/MetricProducer.cpp \
- src/metrics/EventMetricProducer.cpp \
- src/metrics/CountMetricProducer.cpp \
- src/metrics/DurationMetricProducer.cpp \
- src/metrics/duration_helper/OringDurationTracker.cpp \
- src/metrics/duration_helper/MaxDurationTracker.cpp \
- src/metrics/ValueMetricProducer.cpp \
- src/metrics/GaugeMetricProducer.cpp \
- src/metrics/MetricsManager.cpp \
- src/metrics/metrics_manager_util.cpp \
- src/packages/UidMap.cpp \
- src/storage/StorageManager.cpp \
- src/StatsLogProcessor.cpp \
- src/StatsService.cpp \
- src/statscompanion_util.cpp \
- src/subscriber/IncidentdReporter.cpp \
- src/subscriber/SubscriberReporter.cpp \
- src/HashableDimensionKey.cpp \
- src/guardrail/StatsdStats.cpp \
- src/socket/StatsSocketListener.cpp \
- src/shell/ShellSubscriber.cpp \
- src/shell/shell_config.proto
-
-# TODO(b/110563449): Once statsd is using a blueprint file, migrate to the proper filegroups.
-statsd_common_src += \
- ../../../../system/extras/perfprofd/binder_interface/aidl/android/os/IPerfProfd.aidl
-
-statsd_common_c_includes := \
- $(LOCAL_PATH)/src \
- $(LOCAL_PATH)/../../libs/services/include
-
-statsd_common_aidl_includes := \
- $(LOCAL_PATH)/../../core/java
-
-statsd_common_static_libraries := \
- libhealthhalutils
-
-statsd_common_shared_libraries := \
- libbase \
- libbinder \
- libincident \
- liblog \
- libutils \
- libservices \
- libprotoutil \
- libstatslog \
- libhardware \
- libhardware_legacy \
- libhidlbase \
- libhidltransport \
- libhwbinder \
- android.frameworks.stats@1.0 \
- android.hardware.health@2.0 \
- android.hardware.power@1.0 \
- android.hardware.power@1.1 \
- android.hardware.thermal@1.0 \
- libpackagelistparser \
- libsysutils \
- libcutils
-
-# =========
-# statsd
-# =========
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := statsd
-
-LOCAL_SRC_FILES := \
- $(statsd_common_src) \
- src/main.cpp
-
-LOCAL_CFLAGS += \
- -Wall \
- -Wextra \
- -Werror \
- -Wno-unused-parameter
-
-ifeq (debug,)
- LOCAL_CFLAGS += \
- -g -O0
-else
- # optimize for size (protobuf glop can get big)
- LOCAL_CFLAGS += \
- -Os
-endif
-LOCAL_PROTOC_OPTIMIZE_TYPE := lite
-
-LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes)
-LOCAL_C_INCLUDES += $(statsd_common_c_includes)
-
-LOCAL_STATIC_LIBRARIES := $(statsd_common_static_libraries)
-
-LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \
- libgtest_prod
-
-LOCAL_MODULE_CLASS := EXECUTABLES
-
-# Enable sanitizer ONLY on eng builds.
-#ifeq ($(TARGET_BUILD_VARIANT),eng)
-# LOCAL_CLANG := true
-# LOCAL_SANITIZE := address
-#endif
-
-# Add a flag to enable stats log printing from statsd on debug builds.
-ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
- LOCAL_CFLAGS += \
- -DVERY_VERBOSE_PRINTING
-endif
-
-LOCAL_INIT_RC := statsd.rc
-
-include $(BUILD_EXECUTABLE)
-
-
-# ==============
-# statsd_test
-# ==============
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := statsd_test
-LOCAL_COMPATIBILITY_SUITE := device-tests
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes)
-LOCAL_C_INCLUDES += $(statsd_common_c_includes)
-
-LOCAL_CFLAGS += \
- -Wall \
- -Werror \
- -Wno-missing-field-initializers \
- -Wno-unused-variable \
- -Wno-unused-function \
- -Wno-unused-parameter
-
-LOCAL_SRC_FILES := \
- $(statsd_common_src) \
- src/atom_field_options.proto \
- src/atoms.proto \
- src/stats_log.proto \
- src/shell/shell_data.proto \
- tests/AlarmMonitor_test.cpp \
- tests/anomaly/AlarmTracker_test.cpp \
- tests/anomaly/AnomalyTracker_test.cpp \
- tests/ConfigManager_test.cpp \
- tests/external/puller_util_test.cpp \
- tests/indexed_priority_queue_test.cpp \
- tests/LogEntryMatcher_test.cpp \
- tests/LogEvent_test.cpp \
- tests/MetricsManager_test.cpp \
- tests/StatsLogProcessor_test.cpp \
- tests/StatsService_test.cpp \
- tests/UidMap_test.cpp \
- tests/FieldValue_test.cpp \
- tests/condition/CombinationConditionTracker_test.cpp \
- tests/condition/SimpleConditionTracker_test.cpp \
- tests/condition/StateTracker_test.cpp \
- tests/metrics/OringDurationTracker_test.cpp \
- tests/metrics/MaxDurationTracker_test.cpp \
- tests/metrics/CountMetricProducer_test.cpp \
- tests/metrics/DurationMetricProducer_test.cpp \
- tests/metrics/EventMetricProducer_test.cpp \
- tests/metrics/ValueMetricProducer_test.cpp \
- tests/metrics/GaugeMetricProducer_test.cpp \
- tests/guardrail/StatsdStats_test.cpp \
- tests/metrics/metrics_test_helper.cpp \
- tests/statsd_test_util.cpp \
- tests/e2e/WakelockDuration_e2e_test.cpp \
- tests/e2e/MetricActivation_e2e_test.cpp \
- tests/e2e/MetricConditionLink_e2e_test.cpp \
- tests/e2e/Alarm_e2e_test.cpp \
- tests/e2e/Attribution_e2e_test.cpp \
- tests/e2e/GaugeMetric_e2e_push_test.cpp \
- tests/e2e/GaugeMetric_e2e_pull_test.cpp \
- tests/e2e/ValueMetric_pull_e2e_test.cpp \
- tests/e2e/DimensionInCondition_e2e_combination_AND_cond_test.cpp \
- tests/e2e/DimensionInCondition_e2e_combination_OR_cond_test.cpp \
- tests/e2e/DimensionInCondition_e2e_simple_cond_test.cpp \
- tests/e2e/Anomaly_count_e2e_test.cpp \
- tests/e2e/Anomaly_duration_sum_e2e_test.cpp \
- tests/e2e/ConfigTtl_e2e_test.cpp \
- tests/e2e/PartialBucket_e2e_test.cpp \
- tests/shell/ShellSubscriber_test.cpp
-
-LOCAL_STATIC_LIBRARIES := \
- $(statsd_common_static_libraries) \
- libgmock \
- libplatformprotos
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-
-LOCAL_PROTOC_FLAGS := \
- -Iexternal/protobuf/src
-
-LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \
- libprotobuf-cpp-full
-
-include $(BUILD_NATIVE_TEST)
-
-##############################
-# statsd micro benchmark
-##############################
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := statsd_benchmark
-
-LOCAL_SRC_FILES := $(statsd_common_src) \
- src/atom_field_options.proto \
- src/atoms.proto \
- src/stats_log.proto \
- benchmark/main.cpp \
- benchmark/hello_world_benchmark.cpp \
- benchmark/log_event_benchmark.cpp \
- benchmark/stats_write_benchmark.cpp \
- benchmark/filter_value_benchmark.cpp \
- benchmark/get_dimensions_for_condition_benchmark.cpp \
- benchmark/metric_util.cpp \
- benchmark/duration_metric_benchmark.cpp
-
-LOCAL_STATIC_LIBRARIES := \
- $(statsd_common_static_libraries)
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-
-LOCAL_PROTOC_FLAGS := \
- -Iexternal/protobuf/src
-
-LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \
- libprotobuf-cpp-full
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- platformprotoslite
-
-LOCAL_C_INCLUDES := $(statsd_common_c_includes)
-
-LOCAL_CFLAGS := -Wall \
- -Werror \
- -Wno-unused-parameter \
- -Wno-unused-variable \
- -Wno-unused-function \
-
-# Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
-LOCAL_CFLAGS += -Wno-varargs
-
-LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes)
-
-LOCAL_STATIC_LIBRARIES := \
- $(statsd_common_static_libraries) \
- libplatformprotos
-
-LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \
- libgtest_prod \
- libstatslog
-
-LOCAL_MODULE_TAGS := eng tests
-
-include $(BUILD_NATIVE_BENCHMARK)
-
-
-statsd_common_src:=
-statsd_common_aidl_includes:=
-statsd_common_c_includes:=
-statsd_common_static_libraries:=
-statsd_common_shared_libraries:=
-
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/cmds/statsd/tools/Android.mk b/cmds/statsd/tools/Android.mk
deleted file mode 100644
index 7253c96..0000000
--- a/cmds/statsd/tools/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-#Include the sub-makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/cmds/statsd/tools/dogfood/Android.bp b/cmds/statsd/tools/dogfood/Android.bp
new file mode 100644
index 0000000..bb494a6
--- /dev/null
+++ b/cmds/statsd/tools/dogfood/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+android_app {
+ name: "StatsdDogfood",
+ platform_apis: true,
+
+ srcs: ["src/**/*.java"],
+
+ resource_dirs: ["res"],
+ static_libs: [
+ "platformprotoslite",
+ "statsdprotolite",
+ ],
+
+ privileged: true,
+ dex_preopt: {
+ enabled: false,
+ },
+ certificate: "platform",
+ optimize: {
+ enabled: false,
+ },
+}
diff --git a/cmds/statsd/tools/dogfood/Android.mk b/cmds/statsd/tools/dogfood/Android.mk
deleted file mode 100644
index baf235b..0000000
--- a/cmds/statsd/tools/dogfood/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := StatsdDogfood
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
-LOCAL_STATIC_JAVA_LIBRARIES := platformprotoslite \
- statsdprotolite
-
-LOCAL_PRIVILEGED_MODULE := true
-LOCAL_DEX_PREOPT := false
-LOCAL_CERTIFICATE := platform
-LOCAL_PROGUARD_ENABLED := disabled
-
-include $(BUILD_PACKAGE)
diff --git a/cmds/statsd/tools/loadtest/Android.bp b/cmds/statsd/tools/loadtest/Android.bp
new file mode 100644
index 0000000..bf87fc5
--- /dev/null
+++ b/cmds/statsd/tools/loadtest/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+android_app {
+ name: "StatsdLoadtest",
+ platform_apis: true,
+
+ srcs: ["src/**/*.java"],
+
+ resource_dirs: ["res"],
+ static_libs: [
+ "platformprotoslite",
+ "statsdprotolite",
+ ],
+
+ certificate: "platform",
+ privileged: true,
+ dex_preopt: {
+ enabled: false,
+ },
+ optimize: {
+ enabled: false,
+ },
+}
diff --git a/cmds/statsd/tools/loadtest/Android.mk b/cmds/statsd/tools/loadtest/Android.mk
deleted file mode 100644
index 219cd95..0000000
--- a/cmds/statsd/tools/loadtest/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := StatsdLoadtest
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
-LOCAL_STATIC_JAVA_LIBRARIES := platformprotoslite \
- statsdprotolite
-
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-LOCAL_DEX_PREOPT := false
-LOCAL_PROGUARD_ENABLED := disabled
-
-include $(BUILD_PACKAGE)