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

Commit 3f5896c3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "HearingAid RemoveDevice - don't crash when profile not enabled" into pi-dev

parents 0905a7dc b2d296a5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -103,8 +103,13 @@ class HearingAidInterfaceImpl

  void RemoveDevice(const RawAddress& address) override {
    DVLOG(2) << __func__ << " address: " << address;

    // RemoveDevice can be called on devices that don't have HA enabled
    if (HearingAid::IsInitialized()) {
      do_in_bta_thread(FROM_HERE, Bind(&HearingAid::Disconnect,
                                       Unretained(HearingAid::Get()), address));
    }

    do_in_jni_thread(FROM_HERE,
                     Bind(&btif_storage_remove_hearing_aid, address));
  }