Loading service/Android.bp +20 −34 Original line number Diff line number Diff line Loading @@ -23,15 +23,16 @@ filegroup { "src/**/*.java", "src/**/*.kt", ], visibility: [ "//frameworks/base/services", "//frameworks/base/services/core", ], visibility: [":__subpackages__"], } // pre-jarjar version of service-bluetooth that builds against pre-jarjar version of framework-bluetooth java_defaults { name: "service-bluetooth-common-defaults", defaults: ["bluetooth-module-sdk-version-defaults"], name: "service-bluetooth-pre-jarjar", srcs: [ ":services.bluetooth-sources", ], errorprone: { javacflags: [ "-Xep:AlreadyChecked:ERROR", Loading @@ -46,23 +47,6 @@ java_defaults { enabled: false, }, }, apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", defaults_visibility: [ ":__subpackages__", ], } // pre-jarjar version of service-bluetooth that builds against pre-jarjar version of framework-bluetooth java_library { name: "service-bluetooth-pre-jarjar", installable: false, defaults: ["service-bluetooth-common-defaults"], srcs: [ ":services.bluetooth-sources", ], sdk_version: "system_server_current", Loading @@ -85,23 +69,20 @@ java_library { "bluetooth-proto-enums-java-gen", "modules-utils-shell-command-handler", ], visibility: [":__subpackages__"], } // service-bluetooth static library // ============================================================== java_library { name: "service-bluetooth", defaults: ["service-bluetooth-common-defaults"], defaults: ["service-bluetooth-pre-jarjar"], installable: true, static_libs: [ "androidx.appcompat_appcompat", "service-bluetooth-pre-jarjar", ], libs: [ "framework-bluetooth.impl", ], sdk_version: "system_server_current", jarjar_rules: ":bluetooth-jarjar-rules", Loading @@ -113,6 +94,10 @@ java_library { visibility: [ "//packages/modules/Bluetooth/apex", ], apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", } java_library { Loading @@ -136,8 +121,7 @@ java_library { java_library { name: "bluetooth-nano-protos", sdk_version: "system_current", min_sdk_version: "Tiramisu", installable: false, proto: { type: "nano", }, Loading @@ -145,10 +129,12 @@ java_library { ":system-messages-proto-src", ], libs: ["libprotobuf-java-nano"], apex_available: [ "com.android.btservices", ], lint: { strict_updatability_linting: true, }, sdk_version: "system_current", apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", } service/change-ids/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -18,13 +18,16 @@ package { java_library { name: "service-bluetooth.change-ids", defaults: ["service-bluetooth-common-defaults"], srcs: [ "com/android/server/bluetooth/ChangeIds.java", ], libs: [ "app-compat-annotations", ], apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", sdk_version: "system_server_current", } Loading service/tests/Android.bp +7 −19 Original line number Diff line number Diff line Loading @@ -20,50 +20,38 @@ package { android_test { name: "ServiceBluetoothTests", // Linking source to test the working copy, not the on-device copy. // Use 'pre-jarjar' so that we can reference symbols before renaming. // Then apply the same common jarjar_rules defaults: ["service-bluetooth-pre-jarjar"], jarjar_rules: ":bluetooth-jarjar-rules", srcs: [ "src/**/*.java", "src/**/*.kt", ], dxflags: ["--multi-dex"], java_version: "1.9", static_libs: [ "androidx.test.rules", "frameworks-base-testutils", "kotlinx_coroutines_test", "libprotobuf-java-nano", "mockito-target-extended-minus-junit4", "platform-compat-test-rules", "platform-test-annotations", "service-bluetooth.change-ids", "truth-prebuilt", // Statically link service-bluetooth-pre-jarjar since we want to test the working copy of // service-bluetooth, not the on-device copy. // Use pre-jarjar version so that we can reference symbols before they are renamed. // Then, the jarjar_rules here will perform the rename for the entire APK // i.e. service-bluetooth + test code "service-bluetooth-pre-jarjar", ], jarjar_rules: ":bluetooth-jarjar-rules", libs: [ "android.test.base", "android.test.mock", "android.test.runner", "framework-bluetooth-pre-jarjar", ], jni_libs: [ // these are needed for Extended Mockito "libbluetooth_jni", "libdexmakerjvmtiagent", "libstaticjvmtiagent", ], compile_multilib: "both", certificate: ":com.android.bluetooth.certificate", min_sdk_version: "Tiramisu", Loading service/tests/src/com/android/server/bluetooth/BluetoothServiceBinderTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.server.bluetooth; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import static android.Manifest.permission.LOCAL_MAC_ADDRESS; import static android.Manifest.permission.LOG_COMPAT_CHANGE; import static android.Manifest.permission.READ_COMPAT_CHANGE_CONFIG; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -78,6 +76,9 @@ import java.util.function.BooleanSupplier; @RunWith(AndroidJUnit4.class) public class BluetoothServiceBinderTest { private static final String TAG = BluetoothServiceBinderTest.class.getSimpleName(); private static final String LOG_COMPAT_CHANGE = "android.permission.LOG_COMPAT_CHANGE"; private static final String READ_COMPAT_CHANGE_CONFIG = "android.permission.READ_COMPAT_CHANGE_CONFIG"; @Rule public MockitoRule mockito = MockitoJUnit.rule().strictness(STRICT_STUBS); Loading service/tests/src/com/android/server/bluetooth/BluetoothShellCommandTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class BluetoothShellCommandTest { verify(mBinder).enable(any()); } class TestPrivilegedCmd extends BluetoothCommand { static class TestPrivilegedCmd extends BluetoothCommand { TestPrivilegedCmd() { super(true, TestPrivilegedCmd.class.getSimpleName()); } Loading Loading
service/Android.bp +20 −34 Original line number Diff line number Diff line Loading @@ -23,15 +23,16 @@ filegroup { "src/**/*.java", "src/**/*.kt", ], visibility: [ "//frameworks/base/services", "//frameworks/base/services/core", ], visibility: [":__subpackages__"], } // pre-jarjar version of service-bluetooth that builds against pre-jarjar version of framework-bluetooth java_defaults { name: "service-bluetooth-common-defaults", defaults: ["bluetooth-module-sdk-version-defaults"], name: "service-bluetooth-pre-jarjar", srcs: [ ":services.bluetooth-sources", ], errorprone: { javacflags: [ "-Xep:AlreadyChecked:ERROR", Loading @@ -46,23 +47,6 @@ java_defaults { enabled: false, }, }, apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", defaults_visibility: [ ":__subpackages__", ], } // pre-jarjar version of service-bluetooth that builds against pre-jarjar version of framework-bluetooth java_library { name: "service-bluetooth-pre-jarjar", installable: false, defaults: ["service-bluetooth-common-defaults"], srcs: [ ":services.bluetooth-sources", ], sdk_version: "system_server_current", Loading @@ -85,23 +69,20 @@ java_library { "bluetooth-proto-enums-java-gen", "modules-utils-shell-command-handler", ], visibility: [":__subpackages__"], } // service-bluetooth static library // ============================================================== java_library { name: "service-bluetooth", defaults: ["service-bluetooth-common-defaults"], defaults: ["service-bluetooth-pre-jarjar"], installable: true, static_libs: [ "androidx.appcompat_appcompat", "service-bluetooth-pre-jarjar", ], libs: [ "framework-bluetooth.impl", ], sdk_version: "system_server_current", jarjar_rules: ":bluetooth-jarjar-rules", Loading @@ -113,6 +94,10 @@ java_library { visibility: [ "//packages/modules/Bluetooth/apex", ], apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", } java_library { Loading @@ -136,8 +121,7 @@ java_library { java_library { name: "bluetooth-nano-protos", sdk_version: "system_current", min_sdk_version: "Tiramisu", installable: false, proto: { type: "nano", }, Loading @@ -145,10 +129,12 @@ java_library { ":system-messages-proto-src", ], libs: ["libprotobuf-java-nano"], apex_available: [ "com.android.btservices", ], lint: { strict_updatability_linting: true, }, sdk_version: "system_current", apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", }
service/change-ids/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -18,13 +18,16 @@ package { java_library { name: "service-bluetooth.change-ids", defaults: ["service-bluetooth-common-defaults"], srcs: [ "com/android/server/bluetooth/ChangeIds.java", ], libs: [ "app-compat-annotations", ], apex_available: [ "com.android.btservices", ], min_sdk_version: "Tiramisu", sdk_version: "system_server_current", } Loading
service/tests/Android.bp +7 −19 Original line number Diff line number Diff line Loading @@ -20,50 +20,38 @@ package { android_test { name: "ServiceBluetoothTests", // Linking source to test the working copy, not the on-device copy. // Use 'pre-jarjar' so that we can reference symbols before renaming. // Then apply the same common jarjar_rules defaults: ["service-bluetooth-pre-jarjar"], jarjar_rules: ":bluetooth-jarjar-rules", srcs: [ "src/**/*.java", "src/**/*.kt", ], dxflags: ["--multi-dex"], java_version: "1.9", static_libs: [ "androidx.test.rules", "frameworks-base-testutils", "kotlinx_coroutines_test", "libprotobuf-java-nano", "mockito-target-extended-minus-junit4", "platform-compat-test-rules", "platform-test-annotations", "service-bluetooth.change-ids", "truth-prebuilt", // Statically link service-bluetooth-pre-jarjar since we want to test the working copy of // service-bluetooth, not the on-device copy. // Use pre-jarjar version so that we can reference symbols before they are renamed. // Then, the jarjar_rules here will perform the rename for the entire APK // i.e. service-bluetooth + test code "service-bluetooth-pre-jarjar", ], jarjar_rules: ":bluetooth-jarjar-rules", libs: [ "android.test.base", "android.test.mock", "android.test.runner", "framework-bluetooth-pre-jarjar", ], jni_libs: [ // these are needed for Extended Mockito "libbluetooth_jni", "libdexmakerjvmtiagent", "libstaticjvmtiagent", ], compile_multilib: "both", certificate: ":com.android.bluetooth.certificate", min_sdk_version: "Tiramisu", Loading
service/tests/src/com/android/server/bluetooth/BluetoothServiceBinderTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.server.bluetooth; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import static android.Manifest.permission.LOCAL_MAC_ADDRESS; import static android.Manifest.permission.LOG_COMPAT_CHANGE; import static android.Manifest.permission.READ_COMPAT_CHANGE_CONFIG; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -78,6 +76,9 @@ import java.util.function.BooleanSupplier; @RunWith(AndroidJUnit4.class) public class BluetoothServiceBinderTest { private static final String TAG = BluetoothServiceBinderTest.class.getSimpleName(); private static final String LOG_COMPAT_CHANGE = "android.permission.LOG_COMPAT_CHANGE"; private static final String READ_COMPAT_CHANGE_CONFIG = "android.permission.READ_COMPAT_CHANGE_CONFIG"; @Rule public MockitoRule mockito = MockitoJUnit.rule().strictness(STRICT_STUBS); Loading
service/tests/src/com/android/server/bluetooth/BluetoothShellCommandTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class BluetoothShellCommandTest { verify(mBinder).enable(any()); } class TestPrivilegedCmd extends BluetoothCommand { static class TestPrivilegedCmd extends BluetoothCommand { TestPrivilegedCmd() { super(true, TestPrivilegedCmd.class.getSimpleName()); } Loading