Loading Android.bp +1 −0 Original line number Diff line number Diff line package { default_visibility: [":__subpackages__"], default_applicable_licenses: ["system_bt_license"], } Loading AndroidTestTemplate.xml +11 −4 Original line number Diff line number Diff line Loading @@ -17,9 +17,10 @@ <option name="test-suite-tag" value="apct" /> <option name="test-suite-tag" value="apct-native" /> <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" /> <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> <option name="cleanup" value="true" /> <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" /> <option name="append-bitness" value="true" /> </target_preparer> <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> <option name="run-command" value="settings put global ble_scan_always_enabled 0" /> Loading @@ -33,4 +34,10 @@ <option name="module-name" value="{MODULE}" /> <option name="run-test-as" value="0" /> </test> <!-- Only run tests in MTS if the Bluetooth Mainline module is installed. --> <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController"> <option name="mainline-module-package-name" value="com.google.android.bluetooth" /> </object> </configuration> android/app/Android.bp +70 −16 Original line number Diff line number Diff line Loading @@ -32,6 +32,11 @@ java_library { name: "bluetooth.mapsapi", srcs: ["lib/mapapi/**/*.java"], apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", sdk_version: "module_current", } java_library { Loading @@ -39,12 +44,18 @@ java_library { srcs: [":framework-mms-shared-srcs"], libs: ["unsupportedappusage"], apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", sdk_version: "module_current", } // Bluetooth JNI cc_library_shared { name: "libbluetooth_jni", defaults: ["fluoride_full_defaults"], srcs: ["jni/**/*.cpp"], header_libs: [ "jni_headers", Loading @@ -53,14 +64,10 @@ cc_library_shared { include_dirs: [ "packages/modules/Bluetooth/system/types", ], shared_libs: [ "libbase", "libchrome", "liblog", "libnativehelper", ], static_libs: [ "libbluetooth-types", "libbluetooth", "libc++fs", ], cflags: [ "-Wall", Loading @@ -71,24 +78,37 @@ cc_library_shared { sanitize: { scs: true, }, apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", } // Bluetooth APK android_app { name: "Bluetooth", defaults: ["platform_app_defaults"], defaults: ["bluetooth-module-sdk-version-defaults"], srcs: [ "src/**/*.java", ":statslog-bluetooth-java-gen", ], platform_apis: true, certificate: "platform", aaptflags: [ "--custom-package", "com.android.bluetooth" ], certificate: ":com.android.bluetooth.certificate", jarjar_rules: ":bluetooth-jarjar-rules", jni_libs: ["libbluetooth_jni"], jni_uses_platform_apis: true, libs: [ "services.net", "framework-bluetooth-pre-jarjar", "framework-statsd.stubs.module_lib", "framework-tethering.stubs.module_lib", "framework-connectivity.stubs.module_lib", "framework-mediaprovider", "unsupportedappusage", "framework-annotations-lib", "error_prone_annotations", ], static_libs: [ "android.hardware.radio-V1.0-java", Loading @@ -96,10 +116,11 @@ android_app { "androidx.legacy_legacy-support-v4", "androidx.lifecycle_lifecycle-livedata", "androidx.room_room-runtime", "androidx.annotation_annotation", "bluetooth.mapsapi", "bluetooth.obex", "bluetooth-protos-lite", "com.android.vcard", "com.android.obex", "guava", "libprotobuf-java-lite", "mmslib", Loading @@ -108,7 +129,9 @@ android_app { "modules-utils-synchronous-result-receiver", "modules-utils-statemachine", "sap-api-java-static", "services.net", "net-utils-services-common", "networkstack-client", "bluetooth-proto-enums-java-gen", ], plugins: [ Loading @@ -119,11 +142,19 @@ android_app { javacflags: ["-Aroom.schemaLocation=packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/btservice/storage/schemas"], optimize: { enabled: false, enabled: true, shrink: true, optimize: false, proguard_flags_files: ["proguard.flags"], }, required: ["libbluetooth"], required: [ "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", "android.hardware.bluetooth.audio@2.0", "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth.audio-V2-ndk", ], apex_available: [ "//apex_available:platform", "com.android.bluetooth", ], errorprone: { Loading @@ -131,6 +162,24 @@ android_app { // "-Xep:AndroidFrameworkRequiresPermission:ERROR", ], }, min_sdk_version: "Tiramisu", sdk_version: "module_current", } java_library { name: "bluetooth-proto-enums-java-gen", installable: false, proto: { type: "stream", }, srcs: [ ":srcs_bluetooth_protos", ], apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", sdk_version: "module_current", } genrule { Loading @@ -141,3 +190,8 @@ genrule { " --minApiLevel 33", out: ["com/android/bluetooth/BluetoothStatsLog.java"], } android_app_certificate { name: "com.android.bluetooth.certificate", certificate: "certs/com.android.bluetooth" } android/app/AndroidManifest.xml +7 −13 Original line number Diff line number Diff line Loading @@ -4,19 +4,17 @@ package="com.android.bluetooth" android:sharedUserId="android.uid.bluetooth"> <original-package android:name="com.android.bluetooth"/> <!-- Allows access to the Bluetooth Share Manager --> <permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE" android:label="@string/permlab_bluetoothShareManager" android:description="@string/permdesc_bluetoothShareManager" android:protectionLevel="signature"/> android:protectionLevel="signature|privileged"/> <!-- Allows temporarily acceptlisting Bluetooth addresses for sharing --> <permission android:name="com.android.permission.ALLOWLIST_BLUETOOTH_DEVICE" android:label="@string/permlab_bluetoothAcceptlist" android:description="@string/permdesc_bluetoothAcceptlist" android:protectionLevel="signature"/> android:protectionLevel="signature|privileged"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE"/> Loading @@ -31,7 +29,6 @@ <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED"/> <uses-permission android:name="android.permission.BLUETOOTH_MAP"/> <uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE" /> <uses-permission android:name="android.permission.DUMP"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> Loading @@ -56,7 +53,6 @@ <uses-permission android:name="android.permission.NETWORK_FACTORY"/> <uses-permission android:name="android.permission.TETHER_PRIVILEGED"/> <uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/> <uses-permission android:name="android.permission.BLUETOOTH_STACK"/> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/> <uses-permission android:name="android.permission.MANAGE_USERS"/> Loading @@ -79,12 +75,13 @@ <uses-permission android:name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/> <uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS"/> <uses-permission android:name="android.permission.QUERY_AUDIO_STATE"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-sdk android:minSdkVersion="14"/> <!-- For PBAP Owner Vcard Info --> <uses-permission android:name="android.permission.READ_PROFILE"/> <application android:name=".btservice.AdapterApp" <application android:name="com.android.bluetooth.btservice.AdapterApp" android:icon="@mipmap/bt_share" android:persistent="false" android:label="@string/app_name" Loading Loading @@ -520,12 +517,9 @@ <action android:name="android.bluetooth.IBluetoothPbapClient"/> </intent-filter> </service> <!-- Note: This service doesn't get started, it just indicates to the Authentication framework that we can create accounts of a specific type. As such, its safe to have as enabled on all targets and not just the ones that use PBAP Client --> <service android:process="@string/process" android:name="com.android.bluetooth.pbapclient.AuthenticationService" android:enabled="true" android:enabled="false" android:exported="true"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator"/> Loading android/app/certs/com.android.bluetooth.pk8 0 → 100644 +2.32 KiB File added.No diff preview for this file type. View file Loading
Android.bp +1 −0 Original line number Diff line number Diff line package { default_visibility: [":__subpackages__"], default_applicable_licenses: ["system_bt_license"], } Loading
AndroidTestTemplate.xml +11 −4 Original line number Diff line number Diff line Loading @@ -17,9 +17,10 @@ <option name="test-suite-tag" value="apct" /> <option name="test-suite-tag" value="apct-native" /> <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" /> <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> <option name="cleanup" value="true" /> <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" /> <option name="append-bitness" value="true" /> </target_preparer> <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> <option name="run-command" value="settings put global ble_scan_always_enabled 0" /> Loading @@ -33,4 +34,10 @@ <option name="module-name" value="{MODULE}" /> <option name="run-test-as" value="0" /> </test> <!-- Only run tests in MTS if the Bluetooth Mainline module is installed. --> <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController"> <option name="mainline-module-package-name" value="com.google.android.bluetooth" /> </object> </configuration>
android/app/Android.bp +70 −16 Original line number Diff line number Diff line Loading @@ -32,6 +32,11 @@ java_library { name: "bluetooth.mapsapi", srcs: ["lib/mapapi/**/*.java"], apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", sdk_version: "module_current", } java_library { Loading @@ -39,12 +44,18 @@ java_library { srcs: [":framework-mms-shared-srcs"], libs: ["unsupportedappusage"], apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", sdk_version: "module_current", } // Bluetooth JNI cc_library_shared { name: "libbluetooth_jni", defaults: ["fluoride_full_defaults"], srcs: ["jni/**/*.cpp"], header_libs: [ "jni_headers", Loading @@ -53,14 +64,10 @@ cc_library_shared { include_dirs: [ "packages/modules/Bluetooth/system/types", ], shared_libs: [ "libbase", "libchrome", "liblog", "libnativehelper", ], static_libs: [ "libbluetooth-types", "libbluetooth", "libc++fs", ], cflags: [ "-Wall", Loading @@ -71,24 +78,37 @@ cc_library_shared { sanitize: { scs: true, }, apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", } // Bluetooth APK android_app { name: "Bluetooth", defaults: ["platform_app_defaults"], defaults: ["bluetooth-module-sdk-version-defaults"], srcs: [ "src/**/*.java", ":statslog-bluetooth-java-gen", ], platform_apis: true, certificate: "platform", aaptflags: [ "--custom-package", "com.android.bluetooth" ], certificate: ":com.android.bluetooth.certificate", jarjar_rules: ":bluetooth-jarjar-rules", jni_libs: ["libbluetooth_jni"], jni_uses_platform_apis: true, libs: [ "services.net", "framework-bluetooth-pre-jarjar", "framework-statsd.stubs.module_lib", "framework-tethering.stubs.module_lib", "framework-connectivity.stubs.module_lib", "framework-mediaprovider", "unsupportedappusage", "framework-annotations-lib", "error_prone_annotations", ], static_libs: [ "android.hardware.radio-V1.0-java", Loading @@ -96,10 +116,11 @@ android_app { "androidx.legacy_legacy-support-v4", "androidx.lifecycle_lifecycle-livedata", "androidx.room_room-runtime", "androidx.annotation_annotation", "bluetooth.mapsapi", "bluetooth.obex", "bluetooth-protos-lite", "com.android.vcard", "com.android.obex", "guava", "libprotobuf-java-lite", "mmslib", Loading @@ -108,7 +129,9 @@ android_app { "modules-utils-synchronous-result-receiver", "modules-utils-statemachine", "sap-api-java-static", "services.net", "net-utils-services-common", "networkstack-client", "bluetooth-proto-enums-java-gen", ], plugins: [ Loading @@ -119,11 +142,19 @@ android_app { javacflags: ["-Aroom.schemaLocation=packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/btservice/storage/schemas"], optimize: { enabled: false, enabled: true, shrink: true, optimize: false, proguard_flags_files: ["proguard.flags"], }, required: ["libbluetooth"], required: [ "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", "android.hardware.bluetooth.audio@2.0", "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth.audio-V2-ndk", ], apex_available: [ "//apex_available:platform", "com.android.bluetooth", ], errorprone: { Loading @@ -131,6 +162,24 @@ android_app { // "-Xep:AndroidFrameworkRequiresPermission:ERROR", ], }, min_sdk_version: "Tiramisu", sdk_version: "module_current", } java_library { name: "bluetooth-proto-enums-java-gen", installable: false, proto: { type: "stream", }, srcs: [ ":srcs_bluetooth_protos", ], apex_available: [ "com.android.bluetooth", ], min_sdk_version: "Tiramisu", sdk_version: "module_current", } genrule { Loading @@ -141,3 +190,8 @@ genrule { " --minApiLevel 33", out: ["com/android/bluetooth/BluetoothStatsLog.java"], } android_app_certificate { name: "com.android.bluetooth.certificate", certificate: "certs/com.android.bluetooth" }
android/app/AndroidManifest.xml +7 −13 Original line number Diff line number Diff line Loading @@ -4,19 +4,17 @@ package="com.android.bluetooth" android:sharedUserId="android.uid.bluetooth"> <original-package android:name="com.android.bluetooth"/> <!-- Allows access to the Bluetooth Share Manager --> <permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE" android:label="@string/permlab_bluetoothShareManager" android:description="@string/permdesc_bluetoothShareManager" android:protectionLevel="signature"/> android:protectionLevel="signature|privileged"/> <!-- Allows temporarily acceptlisting Bluetooth addresses for sharing --> <permission android:name="com.android.permission.ALLOWLIST_BLUETOOTH_DEVICE" android:label="@string/permlab_bluetoothAcceptlist" android:description="@string/permdesc_bluetoothAcceptlist" android:protectionLevel="signature"/> android:protectionLevel="signature|privileged"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE"/> Loading @@ -31,7 +29,6 @@ <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED"/> <uses-permission android:name="android.permission.BLUETOOTH_MAP"/> <uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE" /> <uses-permission android:name="android.permission.DUMP"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> Loading @@ -56,7 +53,6 @@ <uses-permission android:name="android.permission.NETWORK_FACTORY"/> <uses-permission android:name="android.permission.TETHER_PRIVILEGED"/> <uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/> <uses-permission android:name="android.permission.BLUETOOTH_STACK"/> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/> <uses-permission android:name="android.permission.MANAGE_USERS"/> Loading @@ -79,12 +75,13 @@ <uses-permission android:name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/> <uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS"/> <uses-permission android:name="android.permission.QUERY_AUDIO_STATE"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-sdk android:minSdkVersion="14"/> <!-- For PBAP Owner Vcard Info --> <uses-permission android:name="android.permission.READ_PROFILE"/> <application android:name=".btservice.AdapterApp" <application android:name="com.android.bluetooth.btservice.AdapterApp" android:icon="@mipmap/bt_share" android:persistent="false" android:label="@string/app_name" Loading Loading @@ -520,12 +517,9 @@ <action android:name="android.bluetooth.IBluetoothPbapClient"/> </intent-filter> </service> <!-- Note: This service doesn't get started, it just indicates to the Authentication framework that we can create accounts of a specific type. As such, its safe to have as enabled on all targets and not just the ones that use PBAP Client --> <service android:process="@string/process" android:name="com.android.bluetooth.pbapclient.AuthenticationService" android:enabled="true" android:enabled="false" android:exported="true"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator"/> Loading
android/app/certs/com.android.bluetooth.pk8 0 → 100644 +2.32 KiB File added.No diff preview for this file type. View file