diff options
author | 2025-02-04 16:04:51 -0800 | |
---|---|---|
committer | 2025-02-14 19:30:42 +0000 | |
commit | 9dbe9a85ddc8a05b3f4f7128cdc11428912bf073 (patch) | |
tree | 43430c5ae80f51140733f44c29b5df877eeebf5e /tools | |
parent | d6e9a176ac980e4e61c427dbbd313276a078895e (diff) |
RootCanal: Remove ScriptedBeacon from the device boutique
ScriptedBeacon is still being used indirectly in the HAL
implementation android.hardware.bluetooth@1.1-service.sim
by internal chromecast/nearby tests but never
in the root-canal binary.
Bug: 331817295
Test: m root-canal
Test: m android.hardware.bluetooth@1.1-service.sim
Flag: EXEMPT, tool change
Change-Id: I9124eb7dcecbb0e7580be6cde25f410627c26b46
Diffstat (limited to 'tools')
14 files changed, 18 insertions, 158 deletions
diff --git a/tools/rootcanal/Android.bp b/tools/rootcanal/Android.bp index d18c93d979..b35e46d649 100644 --- a/tools/rootcanal/Android.bp +++ b/tools/rootcanal/Android.bp @@ -95,7 +95,6 @@ cc_library_static { "model/devices/device.cc", "model/devices/hci_device.cc", "model/devices/link_layer_socket_device.cc", - "model/devices/scripted_beacon.cc", "model/devices/sniffer.cc", "model/hci/h4_data_channel_packetizer.cc", "model/hci/h4_parser.cc", @@ -133,9 +132,7 @@ cc_library_static { shared_libs: [ "libbase", "libcrypto", - ], - static_libs: [ - "libscriptedbeaconpayload-protos-lite", + "libprotobuf-cpp-full", ], } @@ -231,17 +228,6 @@ genrule { ], } -cc_library_static { - name: "libscriptedbeaconpayload-protos-lite", - host_supported: true, - proprietary: true, - proto: { - export_proto_headers: true, - type: "lite", - }, - srcs: ["model/devices/scripted_beacon_ble_payload.proto"], -} - cc_test_host { name: "rootcanal_hci_test", defaults: [ @@ -398,7 +384,6 @@ cc_binary_host { "libcrypto", "libgflags", "libprotobuf-cpp-full", - "libscriptedbeaconpayload-protos-lite", ], target: { // TODO(b/181290178) remove it when sanitize option is supported by linux_bionic as well diff --git a/tools/rootcanal/CMakeLists.txt b/tools/rootcanal/CMakeLists.txt index d4791ba6f2..413d2989f7 100644 --- a/tools/rootcanal/CMakeLists.txt +++ b/tools/rootcanal/CMakeLists.txt @@ -131,25 +131,6 @@ pdl_gen( LANG rust_legacy) android_add_library( - TARGET libscriptedbeaconpayload-protos-lite LICENSE Apache-2.0 - SOURCE_DIR ${ROOTCANAL_ROOT} SRC ${libscriptedbeaconpayload_protos_lite_src}) - -protobuf_generate_with_plugin( - TARGET libscriptedbeaconpayload-protos-lite - PROTOS ${ROOTCANAL_ROOT}/model/devices/scripted_beacon_ble_payload.proto - APPEND_PATH - PROTOPATH -I${AOSP_ROOT}/external/protobuf/src - -I${ROOTCANAL_ROOT}/model/devices - PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/model/devices) - -target_include_directories( - libscriptedbeaconpayload-protos-lite - PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${AOSP_ROOT}/external/protobuf/src) - -target_link_libraries(libscriptedbeaconpayload-protos-lite - PRIVATE protobuf::libprotobuf) - -android_add_library( TARGET librootcanal_config LICENSE Apache-2.0 SOURCE_DIR ${ROOTCANAL_ROOT} SRC ${librootcanal_config_src}) @@ -209,7 +190,6 @@ android_add_library( model/devices/device.cc model/devices/hci_device.cc model/devices/link_layer_socket_device.cc - model/devices/scripted_beacon.cc model/devices/sniffer.cc model/hci/h4_data_channel_packetizer.cc model/hci/h4_parser.cc @@ -231,8 +211,7 @@ android_add_library( android-emu-base-headers android-emu-base-logging crypto - librootcanal_config - libscriptedbeaconpayload-protos-lite) + librootcanal_config) target_link_libraries( libbt-rootcanal diff --git a/tools/rootcanal/hal/Android.bp b/tools/rootcanal/hal/Android.bp index f211b70b9c..79af91bfe2 100644 --- a/tools/rootcanal/hal/Android.bp +++ b/tools/rootcanal/hal/Android.bp @@ -22,6 +22,17 @@ package { default_applicable_licenses: ["system_bt_license"], } +cc_library_static { + name: "libscriptedbeaconpayload-protos-lite", + host_supported: true, + proprietary: true, + proto: { + export_proto_headers: true, + type: "lite", + }, + srcs: ["scripted_beacon_ble_payload.proto"], +} + cc_binary { name: "android.hardware.bluetooth@1.1-service.sim", defaults: ["rootcanal_defaults"], @@ -29,6 +40,7 @@ cc_binary { relative_install_path: "hw", srcs: [ "bluetooth_hci.cc", + "scripted_beacon.cc", "service.cc", ], visibility: [ diff --git a/tools/rootcanal/model/devices/scripted_beacon.cc b/tools/rootcanal/hal/scripted_beacon.cc index 1e9bb66349..817a88bc45 100644 --- a/tools/rootcanal/model/devices/scripted_beacon.cc +++ b/tools/rootcanal/hal/scripted_beacon.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "model/devices/scripted_beacon.h" +#include "scripted_beacon.h" #include <unistd.h> @@ -22,8 +22,8 @@ #include <fstream> #include "log.h" -#include "model/devices/scripted_beacon_ble_payload.pb.h" #include "model/setup/device_boutique.h" +#include "scripted_beacon_ble_payload.pb.h" #ifdef _WIN32 #define F_OK 00 diff --git a/tools/rootcanal/model/devices/scripted_beacon.h b/tools/rootcanal/hal/scripted_beacon.h index 05ad079efb..d836c088db 100644 --- a/tools/rootcanal/model/devices/scripted_beacon.h +++ b/tools/rootcanal/hal/scripted_beacon.h @@ -21,7 +21,7 @@ #include <vector> #include "model/devices/beacon.h" -#include "model/devices/scripted_beacon_ble_payload.pb.h" +#include "scripted_beacon_ble_payload.pb.h" using android::bluetooth::rootcanal::model::devices::ScriptedBeaconBleAdProto::PlaybackEvent; diff --git a/tools/rootcanal/model/devices/scripted_beacon_ble_payload.proto b/tools/rootcanal/hal/scripted_beacon_ble_payload.proto index 6f3f792349..6f3f792349 100644 --- a/tools/rootcanal/model/devices/scripted_beacon_ble_payload.proto +++ b/tools/rootcanal/hal/scripted_beacon_ble_payload.proto diff --git a/tools/rootcanal/proto/Android.bp b/tools/rootcanal/proto/Android.bp index ebe45e9a2c..2111bdd7db 100644 --- a/tools/rootcanal/proto/Android.bp +++ b/tools/rootcanal/proto/Android.bp @@ -14,6 +14,7 @@ cc_library_static { proto: { export_proto_headers: true, canonical_path_from_root: false, + type: "full", include_dirs: [ "packages/modules/Bluetooth/tools/rootcanal/proto", ], diff --git a/tools/rootcanal/scripts/scripted_beacon_test/Readme.txt b/tools/rootcanal/scripts/scripted_beacon_test/Readme.txt deleted file mode 100644 index 7ce87779ae..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/Readme.txt +++ /dev/null @@ -1,11 +0,0 @@ -This test: - -- Starts RootCanal -- Adds scripted beacons -- Sets the permissions for some of the files -- Dumps the proto output for manual verification - - -cd $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/vendor_libs/test_vendor_lib -. scripts/scripted_beacon_test/run_test.sh - diff --git a/tools/rootcanal/scripts/scripted_beacon_test/add_beacons b/tools/rootcanal/scripts/scripted_beacon_test/add_beacons deleted file mode 100644 index e6ebf68559..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/add_beacons +++ /dev/null @@ -1,10 +0,0 @@ -wait 1 -add scripted_beacon be:ac:01:55:00:01 scripts/scripted_beacon_test/test_events.pb /tmp/logs/scripted_beacon_test/beacon.pb -add_device_to_phy 1 1 -add scripted_beacon be:ac:01:55:00:02 scripts/scripted_beacon_test/no_permission.pb /tmp/logs/scripted_beacon_test/no_permission.pb -add_device_to_phy 2 1 -add scripted_beacon be:ac:01:55:00:02 scripts/scripted_beacon_test/grant_permission.pb /tmp/logs/scripted_beacon_test/grant_permission.pb -add_device_to_phy 3 1 -list -wait 10 -quit diff --git a/tools/rootcanal/scripts/scripted_beacon_test/grant_permission.pb b/tools/rootcanal/scripts/scripted_beacon_test/grant_permission.pb deleted file mode 100644 index 0e065d749e..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/grant_permission.pb +++ /dev/null @@ -1,21 +0,0 @@ - - -oýoýè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoý ªªªªªªªªªªªªªªª ªªª è
\ No newline at end of file diff --git a/tools/rootcanal/scripts/scripted_beacon_test/no_permission.pb b/tools/rootcanal/scripts/scripted_beacon_test/no_permission.pb deleted file mode 100644 index 0e065d749e..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/no_permission.pb +++ /dev/null @@ -1,21 +0,0 @@ - - -oýoýè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoý ªªªªªªªªªªªªªªª ªªª è
\ No newline at end of file diff --git a/tools/rootcanal/scripts/scripted_beacon_test/run_test.sh b/tools/rootcanal/scripts/scripted_beacon_test/run_test.sh deleted file mode 100644 index a58e9f0a11..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/run_test.sh +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2023 Google LLC -# -# 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 -# -# https://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. - -mkdir -p /tmp/logs/scripted_beacon_test/ -chmod 200 scripts/scripted_beacon_test/no_permission.pb -chmod 200 scripts/scripted_beacon_test/grant_permission.pb -# ls -l scripts/scripted_beacon_test/*.pb -$ANDROID_BUILD_TOP/out/host/linux-x86/bin/root-canal 2> /tmp/logs/scripted_beacon_test/root_canal.log & -sleep 1 -python3 scripts/test_channel.py 6401 < scripts/scripted_beacon_test/add_beacons > /tmp/logs/scripted_beacon_test/test_channel.log & -python3 scripts/hci_socket.py 6402 < scripts/scripted_beacon_test/start_scan > /tmp/logs/scripted_beacon_test/hci_device.log & -sleep 5 -chmod 640 scripts/scripted_beacon_test/grant_permission.pb -# ls -l scripts/scripted_beacon_test/*.pb -sleep 15 -echo "Done" -chmod 640 scripts/scripted_beacon_test/no_permission.pb -# ls -l scripts/scripted_beacon_test/*.pb -gqui /tmp/logs/scripted_beacon_test/*.pb diff --git a/tools/rootcanal/scripts/scripted_beacon_test/start_scan b/tools/rootcanal/scripts/scripted_beacon_test/start_scan deleted file mode 100644 index e345835651..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/start_scan +++ /dev/null @@ -1,3 +0,0 @@ -le_scan 1 -wait 10 -quit diff --git a/tools/rootcanal/scripts/scripted_beacon_test/test_events.pb b/tools/rootcanal/scripts/scripted_beacon_test/test_events.pb deleted file mode 100644 index 0e065d749e..0000000000 --- a/tools/rootcanal/scripts/scripted_beacon_test/test_events.pb +++ /dev/null @@ -1,21 +0,0 @@ - - -oýoýè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoýªªªªªªªªªªªªªªªªªªè -, -oýoý ªªªªªªªªªªªªªªª ªªª è
\ No newline at end of file |