See build/soong/README.md for more information.
Test: m checkbuild
Exempt-From-Owner-Approval: trivial conversion
Change-Id: I417409281c928ea667d937090d2a0d9d72a449a2
+// merge all required services into one jar
+// ============================================================
+java_library {
+ name: "services",
+
+ dex_preopt: {
+ app_image: true,
+ profile: "art-profile",
+ },
+
+ srcs: [
+ "java/**/*.java",
+ ],
+
+ // The convention is to name each service module 'services.$(module_name)'
+ static_libs: [
+ "services.core.priorityboosted",
+ "services.accessibility",
+ "services.appwidget",
+ "services.autofill",
+ "services.backup",
+ "services.companion",
+ "services.coverage",
+ "services.devicepolicy",
+ "services.midi",
+ "services.net",
+ "services.print",
+ "services.restrictions",
+ "services.usage",
+ "services.usb",
+ "services.voiceinteraction",
+ "android.hidl.base-V1.0-java",
+ ],
+
+ libs: [
+ "android.hidl.manager-V1.0-java",
+ ],
+
+ // Uncomment to enable output of certain warnings (deprecated, unchecked)
+ //javacflags: ["-Xlint"],
+
+}
+
// native library
// =============================================================
+++ /dev/null
-LOCAL_PATH:= $(call my-dir)
-
-# merge all required services into one jar
-# ============================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services
-LOCAL_DEX_PREOPT_APP_IMAGE := true
-LOCAL_DEX_PREOPT_GENERATE_PROFILE := true
-LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING := $(LOCAL_PATH)/art-profile
-
-LOCAL_SRC_FILES := $(call all-java-files-under,java)
-
-# EventLogTags files.
-LOCAL_SRC_FILES += \
- core/java/com/android/server/EventLogTags.logtags
-
-# Uncomment to enable output of certain warnings (deprecated, unchecked)
-# LOCAL_JAVACFLAGS := -Xlint
-
-# Services that will be built as part of services.jar
-# These should map to directory names relative to this
-# Android.mk.
-services := \
- core \
- accessibility \
- appwidget \
- autofill \
- backup \
- companion \
- coverage\
- devicepolicy \
- midi \
- net \
- print \
- restrictions \
- usage \
- usb \
- voiceinteraction
-
-# The convention is to name each service module 'services.$(module_name)'
-LOCAL_STATIC_JAVA_LIBRARIES := $(addprefix services.,$(services)) \
- android.hidl.base-V1.0-java \
- android.hardware.biometrics.fingerprint-V2.1-java
-
-LOCAL_JAVA_LIBRARIES := \
- android.hidl.manager-V1.0-java
-
-ifeq ($(EMMA_INSTRUMENT_FRAMEWORK),true)
-LOCAL_EMMA_INSTRUMENT := true
-endif
-
-include $(BUILD_JAVA_LIBRARY)
-
-# =============================================================
-
-ifeq (,$(ONE_SHOT_MAKEFILE))
-# A full make is happening, so make everything.
-include $(call all-makefiles-under,$(LOCAL_PATH))
-else
-# If we ran an mm[m] command, we still want to build the individual
-# services that we depend on. This differs from the above condition
-# by only including service makefiles and not any tests or other
-# modules.
-include $(patsubst %,$(LOCAL_PATH)/%/Android.mk,$(services))
-endif
-
--- /dev/null
+java_library_static {
+ name: "services.accessibility",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.accessibility
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.appwidget",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.appwidget
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.autofill",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.autofill
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.backup",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.backup
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.companion",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.companion
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.core",
+
+ aidl: {
+ include_dirs: [
+ "frameworks/native/aidl/binder",
+ "system/core/storaged/binder",
+ "system/netd/server/binder",
+ "system/vold/binder",
+ ],
+ },
+ srcs: [
+ "java/**/*.java",
+ ":netd_aidl",
+ ":netd_metrics_aidl",
+ ":installd_aidl",
+ ":storaged_aidl",
+ ":vold_aidl",
+ "java/com/android/server/EventLogTags.logtags",
+ "java/com/android/server/am/EventLogTags.logtags",
+ ],
+
+ libs: [
+ "services.net",
+ "android.hardware.light-V2.0-java",
+ "android.hardware.power-V1.0-java",
+ "android.hardware.tv.cec-V1.0-java",
+ "android.hidl.manager-V1.0-java",
+ ],
+
+ static_libs: [
+ "time_zone_distro",
+ "time_zone_distro_installer",
+ "android.hardware.health-V1.0-java",
+ "android.hardware.health-V2.0-java",
+ "android.hardware.weaver-V1.0-java",
+ "android.hardware.biometrics.fingerprint-V2.1-java",
+ "android.hardware.oemlock-V1.0-java",
+ "android.hardware.tetheroffload.control-V1.0-java",
+ "android.hardware.vibrator-V1.0-java",
+ "android.hardware.configstore-V1.0-java",
+ "android.hardware.contexthub-V1.0-java",
+ ],
+}
+
+java_genrule {
+ name: "services.core.priorityboosted",
+ srcs: [":services.core"],
+ tools: ["lockedregioncodeinjection"],
+ cmd: "$(location lockedregioncodeinjection) " +
+ " --targets \"Lcom/android/server/am/ActivityManagerService;,Lcom/android/server/wm/WindowHashMap;\" " +
+ " --pre \"com/android/server/am/ActivityManagerService.boostPriorityForLockedSection,com/android/server/wm/WindowManagerService.boostPriorityForLockedSection\" " +
+ " --post \"com/android/server/am/ActivityManagerService.resetPriorityAfterLockedSection,com/android/server/wm/WindowManagerService.resetPriorityAfterLockedSection\" " +
+ " -o $(out) " +
+ " -i $(in)",
+ out: ["services.core.priorityboosted.jar"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.core
-
-LOCAL_AIDL_INCLUDES := \
- frameworks/native/aidl/binder \
- system/core/storaged/binder \
- system/netd/server/binder \
- system/vold/binder
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java) \
- java/com/android/server/EventLogTags.logtags \
- java/com/android/server/am/EventLogTags.logtags \
- ../../../../system/core/storaged/binder/android/os/IStoraged.aidl \
- ../../../../system/netd/server/binder/android/net/INetd.aidl \
- ../../../../system/netd/server/binder/android/net/metrics/INetdEventListener.aidl \
- ../../../../system/vold/binder/android/os/IVold.aidl \
- ../../../../system/vold/binder/android/os/IVoldListener.aidl \
- ../../../../system/vold/binder/android/os/IVoldTaskListener.aidl \
- ../../../native/cmds/installd/binder/android/os/IInstalld.aidl \
-
-LOCAL_AIDL_INCLUDES += \
- system/netd/server/binder
-
-LOCAL_JAVA_LIBRARIES := \
- services.net \
- android.hardware.light-V2.0-java \
- android.hardware.power-V1.0-java \
- android.hardware.tv.cec-V1.0-java \
- android.hidl.manager-V1.0-java
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- time_zone_distro \
- time_zone_distro_installer \
- android.hidl.base-V1.0-java \
- android.hardware.health-V1.0-java \
- android.hardware.health-V2.0-java \
- android.hardware.weaver-V1.0-java \
- android.hardware.biometrics.fingerprint-V2.1-java \
- android.hardware.oemlock-V1.0-java \
- android.hardware.tetheroffload.control-V1.0-java \
- android.hardware.vibrator-V1.0-java \
- android.hardware.configstore-V1.0-java \
- android.hardware.contexthub-V1.0-java
-
-ifneq ($(INCREMENTAL_BUILDS),)
- LOCAL_PROGUARD_ENABLED := disabled
- LOCAL_JACK_ENABLED := incremental
-endif
-
-LOCAL_JACK_FLAGS := \
- -D jack.transformations.boost-locked-region-priority=true \
- -D jack.transformations.boost-locked-region-priority.classname=com.android.server.am.ActivityManagerService,com.android.server.wm.WindowHashMap \
- -D jack.transformations.boost-locked-region-priority.request=com.android.server.am.ActivityManagerService\#boostPriorityForLockedSection,com.android.server.wm.WindowManagerService\#boostPriorityForLockedSection \
- -D jack.transformations.boost-locked-region-priority.reset=com.android.server.am.ActivityManagerService\#resetPriorityAfterLockedSection,com.android.server.wm.WindowManagerService\#resetPriorityAfterLockedSection
-
-LOCAL_JAR_PROCESSOR := lockedregioncodeinjection
-# Use = instead of := to delay evaluation of ${in} and ${out}
-LOCAL_JAR_PROCESSOR_ARGS = \
- --targets \
- "Lcom/android/server/am/ActivityManagerService;,Lcom/android/server/wm/WindowHashMap;" \
- --pre \
- "com/android/server/am/ActivityManagerService.boostPriorityForLockedSection,com/android/server/wm/WindowManagerService.boostPriorityForLockedSection" \
- --post \
- "com/android/server/am/ActivityManagerService.resetPriorityAfterLockedSection,com/android/server/wm/WindowManagerService.resetPriorityAfterLockedSection" \
- -o ${out} \
- -i ${in}
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.coverage",
+ srcs: ["java/**/*.java"],
+ libs: ["jacocoagent"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.coverage
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := jacocoagent
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.devicepolicy",
+ srcs: ["java/**/*.java"],
+
+ libs: [
+ "conscrypt",
+ "services.core",
+ ],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.devicepolicy
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := conscrypt services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.midi",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.midi
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.net",
+ srcs: ["java/**/*.java"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.net
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_AIDL_INCLUDES += \
- system/netd/server/binder
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.print",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.print
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.restrictions",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.restrictions
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
+++ /dev/null
-LOCAL_PATH:= $(call my-dir)
-
-include $(call all-makefiles-under, $(LOCAL_PATH))
--- /dev/null
+java_library_static {
+ name: "services.usage",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.usage
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.usb",
+ srcs: ["java/**/*.java"],
+
+ libs: [
+ "services.core",
+ "android.hidl.manager-V1.0-java",
+ ],
+
+ static_libs: [
+ "android.hardware.usb-V1.0-java",
+ "android.hardware.usb-V1.1-java",
+ ],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.usb
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core \
-android.hidl.manager-V1.0-java
-
-LOCAL_STATIC_JAVA_LIBRARIES := android.hardware.usb-V1.0-java \
-android.hardware.usb-V1.1-java
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
--- /dev/null
+java_library_static {
+ name: "services.voiceinteraction",
+ srcs: ["java/**/*.java"],
+ libs: ["services.core"],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := services.voiceinteraction
-
-LOCAL_SRC_FILES += \
- $(call all-java-files-under,java)
-
-LOCAL_JAVA_LIBRARIES := services.core
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-java_library_host {
+java_binary_host {
name: "lockedregioncodeinjection",
manifest: "manifest.txt",
srcs: ["src/**/*.java"],