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

Commit 2d219562 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12278291 from 0a6a00fb to 24Q4-release

Change-Id: I8ff75b79d24d8d80a1bc31fbe49e9f56a45bfe66
parents 7307c9b8 0a6a00fb
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -622,10 +622,11 @@ public class BluetoothInCallService extends InCallService {
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE})
    public void onCallAdded(BluetoothCall call) {
        if (call.isExternalCall()) {
            Log.d(TAG, "onCallAdded: external call");
            return;
        }
        if (!mBluetoothCallHashMap.containsKey(call.getId())) {
            Log.d(TAG, "onCallAdded");
            Log.i(TAG, "onCallAdded");
            CallStateCallback callback = new CallStateCallback(call.getState());
            mCallbacks.put(call.getId(), callback);
            call.registerCallback(callback);
@@ -640,6 +641,8 @@ public class BluetoothInCallService extends InCallService {
            if (mBluetoothLeCallControl != null && tbsCall != null) {
                mBluetoothLeCallControl.onCallAdded(tbsCall);
            }
        } else {
            Log.i(TAG, "onCallAdded: call already exists");
        }
    }

@@ -688,7 +691,7 @@ public class BluetoothInCallService extends InCallService {
     */
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE})
    public void onCallRemoved(BluetoothCall call, boolean forceRemoveCallback) {
        Log.d(TAG, "onCallRemoved");
        Log.i(TAG, "onCallRemoved, forceRemoveCallback=" + forceRemoveCallback);
        CallStateCallback callback = getCallback(call);
        if (callback != null && (forceRemoveCallback || !call.isExternalCall())) {
            call.unregisterCallback(callback);
@@ -1334,6 +1337,8 @@ public class BluetoothInCallService extends InCallService {
                    ringingName);

            mHeadsetUpdatedRecently = true;
        } else {
            Log.i(TAG, "updateHeadsetWithCallState skipped");
        }
    }

+10 −0
Original line number Diff line number Diff line
@@ -152,3 +152,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "a2dp_fix_codec_type_in_java"
    namespace: "bluetooth"
    description: "Mask out codec IDs such that they properly reflect unsigned value"
    bug: "361742051"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000);
const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(1000);
// Time bt_stack_manager waits for cleanup profiles
const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100);
// Extra time to wait before terminating the process
const EXTRA_WAIT_BEFORE_KILL_MS: Duration = Duration::from_millis(1000);

const INIT_LOGGING_MAX_RETRY: u8 = 3;

@@ -307,6 +309,10 @@ extern "C" fn handle_sigterm(_signum: i32) {
            log::debug!("Waiting for stack to clean up for {:?}", STACK_CLEANUP_TIMEOUT_MS);
            let _ = notifier.thread_notify.wait_timeout(guard, STACK_CLEANUP_TIMEOUT_MS);
        }

        // Extra delay to give the rest of the cleanup processes some time to finish after
        // finishing btif cleanup.
        std::thread::sleep(EXTRA_WAIT_BEFORE_KILL_MS);
    }

    log::debug!("Sigterm completed");
+4 −0
Original line number Diff line number Diff line
@@ -1553,6 +1553,7 @@ cc_test {
    ],
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/bta",
        "packages/modules/Bluetooth/system/gd",
    ],
    generated_headers: [
@@ -1564,6 +1565,7 @@ cc_test {
        ":TestCommonStackConfig",
        ":TestMockMainShim",
        ":TestMockMainShimEntry",
        ":TestStubOsi",
        "eatt/eatt.cc",
        "test/common/mock_btif_storage.cc",
        "test/common/mock_btm_api_layer.cc",
@@ -1577,6 +1579,7 @@ cc_test {
        "libcutils",
    ],
    static_libs: [
        "bluetooth_flags_c_lib_for_test",
        "libbase",
        "libbluetooth-types",
        "libbluetooth_gd",
@@ -1593,6 +1596,7 @@ cc_test {
        "libosi",
        "libprotobuf-cpp-lite",
        "libstatslog_bt",
        "server_configurable_flags",
    ],
    target: {
        android: {
+7 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
 */

#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>

#include <map>
#include <vector>
@@ -710,9 +711,13 @@ struct eatt_impl {
    EattChannel* channel = (EattChannel*)data;
    tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(channel->bda_, BT_TRANSPORT_LE);

    log::warn("disconnecting...");
    log::warn("disconnecting channel {:#x} for {}", channel->cid_, channel->bda_);
    if (com::android::bluetooth::flags::gatt_disconnect_fix()) {
      EattExtension::GetInstance()->Disconnect(channel->bda_, channel->cid_);
    } else {
      gatt_disconnect(p_tcb);
    }
  }

  void start_indication_confirm_timer(const RawAddress& bd_addr, uint16_t cid) {
    EattChannel* channel = find_eatt_channel_by_cid(bd_addr, cid);
Loading