summaryrefslogtreecommitdiff
path: root/service/src
AgeCommit message (Collapse)Author
2025-03-15SystemServer: race between enableBle and apm William Escande
If apm spawn two event back to back, the second will be queued up to when Bluetooth reach a stable state (BLE_ON or ON or OFF). But as soon as Bluetooth exit BLE_ON, some apps may ask to restart the BLE part. This event is handled and because the apm event is delayed on a timer, it will be treated at a later date. To prevent this, we are cancelling the queued apm event and executing it directly once reaching OFF, before to generate a "restart" event Bug: 402563502 Bug: 402332571 Test: atest ServiceBluetoothTests Flag: com.android.bluetooth.flags.enable_ble_while_disabling_airplane Change-Id: I2c22468e82404618f75eb2576c83c5231b004278
2025-03-12Clean system server threads William Escande
Bug: 402209603 Flag: com.android.bluetooth.flags.system_server_remove_extra_thread_jump Test: atest ServiceBluetoothTests Change-Id: Ic73976f7bfd92da873c95412ba0fa0181b112c85
2025-03-11SystemServer: Improve test checks William Escande
Tests are now using: * inOrder to validate the order of event * Intent matcher to better validate what has been broadcasted Bug: 402332571 Flag: TEST_ONLY Test: atest ServiceBluetoothTests Change-Id: I91750faa6dd8159ba7afa5ab92e83100578a45e6
2025-03-11Merge changes from topic "bluetooth-manager-service-proto" into main Henri Chataing
* changes: BluetoothManagerService: Remove proto dump Remove legacy definitions from BluetoothMetricsProto
2025-03-10Extract delayed method out of the handler William Escande
Bug: 402209603 Flag: com.android.bluetooth.flags.system_server_remove_extra_thread_jump Test: m . Change-Id: I4938253267d2db17b4488aff3f7aa0ea207b8698
2025-03-10BluetoothManagerService: Remove proto dump Henri Chataing
Added by the Android Health team to dump structured bt stats through the bluetooth_manager dumpsys on incident reports. This has now been deprecated and the proto output can be removed. Bug: 331817295 Test: m com.android.bt Flag: EXEMPT, dead code removal Change-Id: I06b9d6a9937582d2692df7c4e5e59fd24c60d999
2025-03-0925Q1 flag removal: get_name_and_address_as_callback William Escande
Bug: 368114370 Fix: 368114370 Flag: com.android.bluetooth.flags.get_name_and_address_as_callback Test: m com.android.bt Change-Id: Ic5def8cdf322302678f981e1164334be7a812ca9
2025-03-0925Q1 flag removal: enforce_resolve_system_service_behavior William Escande
Bug: 366273182 Fix: 366273182 Flag: com.android.bluetooth.flags.enforce_resolve_system_service_behavior Test: m com.android.bt Change-Id: If256127c2e74c514007a315e479cc0c7780ffe9d
2025-03-0925Q1 flag removal: remove_one_time_get_name_and_address William Escande
Bug: 368120237 Fix: 368120237 Flag: com.android.bluetooth.flags.remove_one_time_get_name_and_address Test: m com.android.bt Change-Id: I040a06a79541b0f4e6ba4c9660d1a6311b66b016
2025-03-0925Q1 flag removal: get_state_from_system_server William Escande
Bug: 362569584 Fix: 362569584 Flag: com.android.bluetooth.flags.get_state_from_system_server Test: m com.android.bt Change-Id: I0156a3a4f7f60e4c1c44cb9245c52946e21f568c
2025-03-04Errorprone fix & enforce FieldCanBeFinal William Escande
Bug: 344658662 Test: m BluetoothInstrumentationTests Test: m . Flag: Exempt refactor Change-Id: Iea773640f276794f32020685feb886b53485a0c1
2025-02-25Merge "Errorprone fix & enforce MethodCanBeStatic" into main William Escande
2025-02-24Errorprone fix & enforce MethodCanBeStatic William Escande
Bug: 344658662 Test: m BluetoothInstrumentationTests Test: m . Flag: Exempt refactor Change-Id: Ibde1dabbb1ba64cd278e9607e29dec04e70b1bb9
2025-02-21SystemServer: improve coverage detection William Escande
Overload annotation is creating as many overload as possible and they appear uncovered in test, while they are. Deleting the overload and manually implement the only 2 necessary help for detection Bug: 311772251 Flag: Exempt refactor Test: atest ServiceBluetoothRoboTests Change-Id: I62c533f349c24b2943e4fd184b9e8add20c86b06
2025-02-16Merge "Disable components of bluetooth package in PackageManager on HAL ↵ DC Xu
crash" into main
2025-02-14Disable components of bluetooth package in PackageManager on HAL crash DC Xu
This change addresses the issue where telephony fails to re-bind Bluetooth after recovering from a BT HAL crash during an active call. A PACKAGE_CHANGED intent from PackageManager will now trigger re-binding. This change disables dynamically enabled services on MESSAGE_BLUETOOTH_SERVICE_DISCONNECTED received in BluetoothManagerService Bug: 389540919 Bug: 391084450 Test: atest & tester verification Flag: com.android.bluetooth.flags.set_component_available_fix Change-Id: I46d1f56d222d9e2f52424fc12fb54c68c5c5c74d
2025-01-28BluetoothService: Respect config_hsumBootStrategy Hsin-chen Chuang
The HSUM model has changed and this patch applies the new strategy. Bug: 389067454 Test: mmm packages/modules/Bluetooth Test: Deploy to DUT, Settings App can discover new Bluetooth devices Flag: EXEMPT, behind new config Change-Id: I18afadccc17b9478f4ebec5a139a51404192188e
2025-01-15Print the attributionSource used for permission William Escande
Bug: 390228376 Fix: 390228376 Flag: Exempt log modification Test: m com.android.bt Change-Id: Ic4f51923a4efdeef9c2472601ce6c08103011896
2024-12-1024Q4: Removal of respect_ble_scan_setting William Escande
Bug: 341783936 Fix: 341783936 Flag: com.android.bluetooth.flags.respect_ble_scan_setting Test: atest ServiceBluetoothRoboTests Change-Id: I8e9fd57087e4d7cd19566d0356863cea2c24b732
2024-12-04Early flag removal for ble_scan_setting William Escande
Note that this change is also behind respect_ble_scan_setting Bug: 380917653 Bug: 379166793 Fix: 379166793 Test: m bluetooth | There are no automatic test for scan_setting Flag: com.android.bluetooth.flags.ble_scan_setting_does_not_disconnect_if_bt_on Change-Id: Ic19f534bcf8ad57b7c223bd6dbc699cca762a24d
2024-11-19SystemServer: Extends error prone enforced list William Escande
Also fixed the reported warning Bug: 311772251 Test: m . Flag: Exempt refactor Change-Id: I99eb7e12468d2b07982f7ce69a53cc0c5e2c9d12
2024-11-14SystemServer: keep gatt apps when scan disallowed William Escande
When disallowing "scan while bluetooth is OFF", if bluetooth is ON, it make no sense to disconnect the apps. This change will keep the apps connected. If bluetooth is in ble states, it also doesn't make sense because we are gonna shut off the bluetooth anyway. So gatt will proceed to the registration on its own Bug: 379166793 Bug: 378031425 Test: m . | no test for API user journey yet Flag: com.android.bluetooth.flags.ble_scan_setting_does_not_disconnect_if_bt_on Change-Id: I982571e5f0e457cf6ee927393eca01185658c834
2024-11-05BluetoothAdapter: cleanup William Escande
no-op cleanup found after restoring BluetoothAdapterTest Bug: 371656429 Test: atest CtsBluetoothTestCases Flag: TEST_ONLY Change-Id: I611f330a4ada51d529ff332fc2397922931391d1
2024-10-30SystemServer: remove fast_bind_to_app William Escande
Bug: 328698375 Flag: com.android.bluetooth.flags.fast_bind_to_app Test: m . | any test that turn on & off the Bluetooth Change-Id: I511123324f8eedbbe8ddcb886d6fc94e0d17775e
2024-10-26SystemServer: reduce callback visibility William Escande
Bug: 289584302 Test: m . Flag: com.android.bluetooth.flags.use_new_satellite_mode Change-Id: Ia92cb32676d2f0ed9eac98c699e28efbbda91e31
2024-10-25SystemServer: Airplane change when FactoryReset William Escande
When receiving ACTION_SETTING_RESTORED we temporarily set the persisted state to off. If we leave airplane mode before the restore is executed we will have a race condition on the start of the bluetooth. This CL adds a check on the persistedState, to make sure we do not wrongly interact with it Bug: 328842491 Fix: 328842491 Test: atest ServiceBluetoothTests Test: atest disableAirplane_whenFactoryReset_doesNotStartBluetooth Test: atest disableAirplane_whenNothing_startBluetooth Flag: Exempt, Adding a flag here does not add DF value as it is a very edge case (you need to stress test factory reset & airplane mode) Change-Id: I969e156c9f289aa0088887d8c7fafca15a4bc843
2024-10-25Remove un-necessary post William Escande
Airplane and satellite handler are running on the correct looper. post is not necessary For userSwitch posting delayed with a 0 delay isn't giving value. finally, remove the synchronized in the airplane handler as this is not called by multiples thread Bug: 328842491 Flag: Exempt, no-op Test: atest ServiceBluetoothTests Change-Id: I4d2e8d7bf6e25ca36157aa2d9ac9dc4ee8fd36f0
2024-10-25Untangled RESTORE_USER_SETTING message William Escande
Using a different message for OFF and ON is way much clearer, especially with incoming test Bug: 328842491 Flag: Exempt, no-op Test: atest ServiceBluetoothTests Change-Id: I2ac8526c0395762748fb22a17613b6bbe2f61e17
2024-10-09SystemServer: add logging on some binder call William Escande
It would be interesting to know when the binder call is received compare to when the binder call is processed by the correct thread Bug: 361512704 Test: atest ServiceBluetoothTests Flag: Exempt logging Change-Id: I69f519a6e602cf87c35c5d40f30b02e3dddbd6a5
2024-10-07GetName/SetName: Broadcast intent from server William Escande
Since the server is responsible for having an up to date name, it make sense for it to be the source of the associated intent. Bug: 371656429 Bug: 368114370 Flag: com.android.bluetooth.flags.get_name_and_address_as_callback Test: atest CtsBluetoothTestCases:BluetoothAdapterTest#setName_getName Change-Id: I8cfe2d73d160db86c20bbb4296e004e555671cb1
2024-10-03Merge "SystemServer: remove dead code in proxy" into main Treehugger Robot
2024-10-03SystemServer: parametrized test for current flags William Escande
also fix current test mocking failure with the flag get_name_and_address_as_callback Flag: com.android.bluetooth.flags.get_name_and_address_as_callback Test: atest ServiceBluetoothTests Bug: 368114370 Change-Id: I6ba6b33bab661a8c3a934f8860e073bca149ad88
2024-10-03SystemServer: remove dead code in proxy William Escande
Bug: 311772251 Flag: Exempt refactor Test: m Bluetooth Change-Id: I59508361143510e46809ae111d117803258ef840
2024-10-02Merge changes I0275a64f,Ib32abd5b into main Treehugger Robot
* changes: SystemServer: test race condition on enable SystemServer: Remove un-necessary synchronize
2024-10-01SystemServer: Remove un-necessary synchronize William Escande
All this code is running on a unique handler. The synchronize keyword is coming from legacy and doesn't make sense anymore Bug: 288450479 Test: m Bluetooth Flag: Exempt trivial removal Change-Id: Ib32abd5bba95e2670804e8dcfcf8555d21907407
2024-10-01SystemServer: prevent state change after crash William Escande
Bug: 369633468 Fix: 369633468 Flag: Exempt null check Test: m ServiceBluetoothTests Change-Id: I83442a318889023d4882133666c99c93b1bac625
2024-09-19SystemServer: getName & Address are now callback William Escande
Bug: 368114370 Test: atest ServiceBluetoothTests Flag: com.android.bluetooth.flags.get_name_and_address_as_callback Change-Id: If8e0d9127f0f529e97b8b1fe08329e1b5834f8c7
2024-09-19SystemServer: remove get_name_and_address step William Escande
Bug: 368120237 Test: m Bluetooth Flag: com.android.bluetooth.flags.remove_one_time_get_name_and_address Change-Id: I6543a8cc52e22ab1e3583bb89f13e14092194b08
2024-09-13Merge "SystemServer: Broadcast callback no longer need synchro" into main Treehugger Robot
2024-09-13SystemServer: Broadcast callback no longer need synchro William Escande
RemoteCallbackList implements synchronization which enables calling register / unregister as a broadcast is active. It is still invalid to start two concurrent broadcasts, but this possibility is prevented by the fact that broadcasts are now all run on the same thread. Bug: 288450479 Test: m Bluetooth Flag: Exempt refactor cleanup Change-Id: I505d61049eb5b643d3e993dd5ddd2404b3f6cf9a
2024-09-13SystemServer: Enforce ResolveIntentService behavior William Escande
If there are no services or more than 1 service, we want to detect it early on in development and crash the whole process ASAP Bug: 311772251 Bug: 366273182 Test: Boot devices + Bluetooth Test: m Bluetooth Flag: com.android.bluetooth.flags.enforce_resolve_system_service_behavior Change-Id: I9862e2fc90deab09eece4f46e2d5714c502ecbbe
2024-09-13Merge "SystemServer: use adapter after null check" into main Treehugger Robot
2024-09-12SystemServer: use adapter after null check William Escande
We perform the check on adapter and not on mAdapter. We should then use adapter and not the mAdapter (since it can change meantime) Bug: 311772251 Flag: Exempt trivial typo fix Test: m Bluetooth Change-Id: I4916bd76e9a8c237e2c48530fdd22bd4dfafcda6
2024-09-12Merge "SystemServer: check null when Bluetooth crash" into main Treehugger Robot
2024-09-12Merge "SystemServer: unbind prior to setting state" into main William Escande
2024-09-12Flag 24Q3: remove auto_on_feature William Escande
Bug: 323060869 Fix: 323060869 Test: atest ServiceBluetoothRoboTests Flag: com.android.bluetooth.flags.auto_on_feature Change-Id: I5b29593925bcf4c87f2c0e7c6c6a46e9737406b7
2024-09-12SystemServer: check null when Bluetooth crash William Escande
Bug: 366119162 Fix: 366119162 Test: m Bluetooth Test: start bluetooth, make the bluetooth crash, service should recover Flag: Exempt, P0 regression fixing Change-Id: I457ee96fc460c389ff7015a4cae838d857938632
2024-09-12SystemServer: unbind prior to setting state William Escande
When transitioning to stateOff, the caller of `waitForState` are notified before the unbind is completed. The caller will expect that when reaching OFF, everything is OFF. By calling unbindAndFinish prior to setting the state, we reduce the probability of this scenario Test: atest ServiceBluetoothRoboTests Test: atest ServiceBluetoothTests Test: atest CtsBluetoothTestCases Test: basically any code that toggles Bluetooth off and on Flag: Exempt this targets flakiness and is checked with abtd Bug: 361850050 Change-Id: If3a5e6e358e295a2f77619d5f1c82c69c950a6e2
2024-09-12SystemServer: cleanup dump William Escande
Bug: 311772251 Test: m Bluetooth Flag: Exempt refactor Change-Id: Idba6b8ff1215744c13c241d93521be03fff2faa5
2024-09-11SystemServer: simplify too verbose documentation William Escande
Bug: 311772251 Test: m Bluetooth Flag: Exempt documentation only Change-Id: I8c04ce776e484d0b94292223db1b6c8cd69433a7