Loading framework/Android.bp +3 −3 Original line number Diff line number Diff line Loading @@ -82,10 +82,10 @@ java_sdk_library { }, } // defaults for CTS tests that need to build against framework-bluetooths's @hide APIs // defaults for tests that need to build against framework-bluetooths's @hide APIs java_defaults { name: "framework-bluetooth-cts-defaults", sdk_version: "core_current", name: "framework-bluetooth-tests-defaults", sdk_version: "core_platform", libs: [ // order matters: classes in framework-bluetooth are resolved before framework, meaning // @hide APIs in framework-bluetooth are resolved before @SystemApi stubs in framework Loading framework/tests/Android.bp +14 −2 Original line number Diff line number Diff line Loading @@ -4,8 +4,18 @@ package { android_test { name: "BluetoothTests", defaults: ["framework-bluetooth-tests-defaults"], min_sdk_version: "current", target_sdk_version: "current", // Include all test java files. srcs: ["src/**/*.java"], jacoco: { include_filter: ["android.bluetooth.*"], exclude_filter: [], }, libs: [ "android.test.runner", "android.test.base", Loading @@ -14,6 +24,8 @@ android_test { "junit", "modules-utils-bytesmatcher", ], platform_apis: true, certificate: "platform", test_suites: [ "general-tests", "mts-bluetooth", ], } service/Android.bp +2 −4 Original line number Diff line number Diff line Loading @@ -91,15 +91,13 @@ java_library { ], sdk_version: "system_server_current", jarjar_rules: ":bluetooth-jarjar-rules", optimize: { enabled: true, shrink: true, proguard_flags_files: ["proguard.flags"], }, dex_preopt: { enabled: false, app_image: false, }, visibility: [ "//packages/modules/Bluetooth/apex", ], Loading service/tests/Android.bp +51 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,54 @@ filegroup { "//frameworks/base/services/tests/servicestests", ], } android_test { name: "ServiceBluetoothTests", srcs: [ "src/**/*.java", ], dxflags: ["--multi-dex"], java_version: "1.9", static_libs: [ "androidx.test.rules", "collector-device-lib", "hamcrest-library", "mockito-target-extended-minus-junit4", "platform-test-annotations", "frameworks-base-testutils", "truth-prebuilt", // Statically link service-bluetooth-pre-jarjar since we want to test the working copy of // service-uwb, 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.runner", "android.test.base", "android.test.mock", "framework-bluetooth-pre-jarjar", ], jni_libs: [ // these are needed for Extended Mockito "libbluetooth_jni", ], compile_multilib: "both", min_sdk_version: "current", test_suites: [ "general-tests", "mts-bluetooth", ], } service/tests/AndroidManifest.xml 0 → 100644 +42 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2015 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 --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.server.bluetooth.test"> <application android:debuggable="true" android:largeHeap="true"> <uses-library android:name="android.test.runner"/> <activity android:label="BluetoothTestDummyLabel" android:name="BluetoothTestDummyName" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <instrumentation android:name="com.android.server.bluetooth.CustomTestRunner" android:targetPackage="com.android.server.bluetooth.test" android:label="Service Bluetooth Tests"> </instrumentation> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> </manifest> Loading
framework/Android.bp +3 −3 Original line number Diff line number Diff line Loading @@ -82,10 +82,10 @@ java_sdk_library { }, } // defaults for CTS tests that need to build against framework-bluetooths's @hide APIs // defaults for tests that need to build against framework-bluetooths's @hide APIs java_defaults { name: "framework-bluetooth-cts-defaults", sdk_version: "core_current", name: "framework-bluetooth-tests-defaults", sdk_version: "core_platform", libs: [ // order matters: classes in framework-bluetooth are resolved before framework, meaning // @hide APIs in framework-bluetooth are resolved before @SystemApi stubs in framework Loading
framework/tests/Android.bp +14 −2 Original line number Diff line number Diff line Loading @@ -4,8 +4,18 @@ package { android_test { name: "BluetoothTests", defaults: ["framework-bluetooth-tests-defaults"], min_sdk_version: "current", target_sdk_version: "current", // Include all test java files. srcs: ["src/**/*.java"], jacoco: { include_filter: ["android.bluetooth.*"], exclude_filter: [], }, libs: [ "android.test.runner", "android.test.base", Loading @@ -14,6 +24,8 @@ android_test { "junit", "modules-utils-bytesmatcher", ], platform_apis: true, certificate: "platform", test_suites: [ "general-tests", "mts-bluetooth", ], }
service/Android.bp +2 −4 Original line number Diff line number Diff line Loading @@ -91,15 +91,13 @@ java_library { ], sdk_version: "system_server_current", jarjar_rules: ":bluetooth-jarjar-rules", optimize: { enabled: true, shrink: true, proguard_flags_files: ["proguard.flags"], }, dex_preopt: { enabled: false, app_image: false, }, visibility: [ "//packages/modules/Bluetooth/apex", ], Loading
service/tests/Android.bp +51 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,54 @@ filegroup { "//frameworks/base/services/tests/servicestests", ], } android_test { name: "ServiceBluetoothTests", srcs: [ "src/**/*.java", ], dxflags: ["--multi-dex"], java_version: "1.9", static_libs: [ "androidx.test.rules", "collector-device-lib", "hamcrest-library", "mockito-target-extended-minus-junit4", "platform-test-annotations", "frameworks-base-testutils", "truth-prebuilt", // Statically link service-bluetooth-pre-jarjar since we want to test the working copy of // service-uwb, 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.runner", "android.test.base", "android.test.mock", "framework-bluetooth-pre-jarjar", ], jni_libs: [ // these are needed for Extended Mockito "libbluetooth_jni", ], compile_multilib: "both", min_sdk_version: "current", test_suites: [ "general-tests", "mts-bluetooth", ], }
service/tests/AndroidManifest.xml 0 → 100644 +42 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2015 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 --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.server.bluetooth.test"> <application android:debuggable="true" android:largeHeap="true"> <uses-library android:name="android.test.runner"/> <activity android:label="BluetoothTestDummyLabel" android:name="BluetoothTestDummyName" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <instrumentation android:name="com.android.server.bluetooth.CustomTestRunner" android:targetPackage="com.android.server.bluetooth.test" android:label="Service Bluetooth Tests"> </instrumentation> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> </manifest>