Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e0be6a7 authored by William Escande's avatar William Escande
Browse files

Msft: Remove dead code from android target

msft hci command is considered as dead code on android as the feature
does not work by design.
In order to make it obvious this is not working, this CL removes the
code path from within phone binary

Test: mmm packages/modules/Bluetooth/system/gd
Bug: 311772251
Flag: Exempt, dead code removal
Change-Id: I192186d7a29b678feb20208110ef4926f46d0104
parent b7a810d9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ filegroup {
        "le_scanning_manager.cc",
        "le_scanning_reassembler.cc",
        "link_key.cc",
        "msft.cc",
        "remote_name_request.cc",
        "uuid.cc",
        "vendor_specific_event_manager.cc",
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#if TARGET_FLOSS
#include "hci/msft.h"

#include <bluetooth/log.h>
@@ -352,3 +353,4 @@ void MsftExtensionManager::SetScanningCallback(ScanningCallback* callbacks) {

}  // namespace hci
}  // namespace bluetooth
#endif
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
 * limitations under the License.
 */
#pragma once
#if TARGET_FLOSS

#include "hci/hci_packets.h"
#include "hci/le_scanning_callback.h"
@@ -60,3 +61,4 @@ class MsftExtensionManager : public bluetooth::Module {

}  // namespace hci
}  // namespace bluetooth
#endif
+15 −0
Original line number Diff line number Diff line
@@ -252,6 +252,8 @@ void BleScannerIntf::ScanFilterEnable(bool enable) {
  scanner_intf_->ScanFilterEnable(enable, base::Bind(&BleScannerIntf::OnEnableCallback, base::Unretained(this)));
}

#if TARGET_FLOSS

bool BleScannerIntf::IsMsftSupported() {
  return scanner_intf_->IsMsftSupported();
}
@@ -272,6 +274,17 @@ void BleScannerIntf::MsftAdvMonitorEnable(uint32_t call_id, bool enable) {
      enable, base::Bind(&BleScannerIntf::OnMsftAdvMonitorEnableCallback, base::Unretained(this), call_id));
}

#else

bool BleScannerIntf::IsMsftSupported() {
  return false;
}
void BleScannerIntf::MsftAdvMonitorAdd(uint32_t, const RustMsftAdvMonitor&) {}
void BleScannerIntf::MsftAdvMonitorRemove(uint32_t, uint8_t) {}
void BleScannerIntf::MsftAdvMonitorEnable(uint32_t, bool) {}

#endif

void BleScannerIntf::SetScanParameters(
    uint8_t scanner_id,
    uint8_t scan_type,
@@ -365,6 +378,7 @@ void BleScannerIntf::OnFilterConfigCallback(
  rusty::gdscan_filter_config_callback(filter_index, filt_type, avbl_space, action, btm_status);
}

#if TARGET_FLOSS
void BleScannerIntf::OnMsftAdvMonitorAddCallback(uint32_t call_id, uint8_t monitor_handle, uint8_t status) {
  rusty::gdscan_msft_adv_monitor_add_callback(call_id, monitor_handle, status);
}
@@ -376,6 +390,7 @@ void BleScannerIntf::OnMsftAdvMonitorRemoveCallback(uint32_t call_id, uint8_t st
void BleScannerIntf::OnMsftAdvMonitorEnableCallback(uint32_t call_id, uint8_t status) {
  rusty::gdscan_msft_adv_monitor_enable_callback(call_id, status);
}
#endif

void BleScannerIntf::OnPeriodicSyncStarted(
    int,
+2 −0
Original line number Diff line number Diff line
@@ -180,9 +180,11 @@ class BleScannerIntf : public ScanningCallbacks {
  void OnFilterParamSetupCallback(uint8_t scanner_id, uint8_t avbl_space, uint8_t action_type, uint8_t btm_status);
  void OnFilterConfigCallback(
      uint8_t filt_index, uint8_t filt_type, uint8_t avbl_space, uint8_t action, uint8_t btm_status);
#if TARGET_FLOSS
  void OnMsftAdvMonitorAddCallback(uint32_t call_id, uint8_t monitor_handle, uint8_t status);
  void OnMsftAdvMonitorRemoveCallback(uint32_t call_id, uint8_t status);
  void OnMsftAdvMonitorEnableCallback(uint32_t call_id, uint8_t status);
#endif

  BleScannerInterface* scanner_intf_;
};
Loading