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

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

Snap for 12272146 from 0cc1ba88 to 24Q4-release

Change-Id: I5f09b97996e95ca39e13156830947670f91de2cc
parents e80d3cc4 0cc1ba88
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ public class RemoteDevices {
                case MESSAGE_UUID_INTENT:
                    BluetoothDevice device = (BluetoothDevice) msg.obj;
                    if (device != null) {
                        debugLog("MESSAGE_UUID_INTENT: " + device);
                        // SDP Sending delayed SDP UUID intent
                        MetricsLogger.getInstance()
                                .cacheCount(BluetoothProtoEnums.SDP_SENDING_DELAYED_UUID, 1);
@@ -739,7 +740,19 @@ public class RemoteDevices {

        // SDP Sent UUID Intent here
        MetricsLogger.getInstance().cacheCount(BluetoothProtoEnums.SDP_SENT_UUID, 1);

        // Remove the outstanding UUID request
        if (Flags.preventDuplicateUuidIntent()) {
            // Handler.removeMessages() compares the object pointer so we cannot use the device
            // directly. So we have to extract original BluetoothDevice object from mSdpTracker.
            int index = mSdpTracker.indexOf(device);
            if (index >= 0) {
                BluetoothDevice originalDevice = mSdpTracker.get(index);
                if (originalDevice != null) {
                    mHandler.removeMessages(MESSAGE_UUID_INTENT, originalDevice);
                }
            }
        }
        mSdpTracker.remove(device);
    }

+2 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ class Gatt(private val context: Context) : GATTImplBase(), Closeable {
    private val serverManager by lazy { GattServerManager(mBluetoothManager, context, mScope) }

    private val flow: Flow<Intent>

    init {
        val intentFilter = IntentFilter()
        intentFilter.addAction(BluetoothDevice.ACTION_UUID)
@@ -128,7 +129,7 @@ class Gatt(private val context: Context) : GATTImplBase(), Closeable {
            // we need to wait until the service discovery is finished to be able to discover again.
            // This takes between 20s and 28s, and there is no way to know if the service is busy or
            // not.
            // Delay was originally 30s, but due to flakyness increased to 32s.
            // Delay was originally 30s, but due to flakiness increased to 32s.
            delay(32000L)
            check(gattInstance.mGatt.discoverServiceByUuid(UUID.fromString(request.uuid)))
            // BluetoothGatt#discoverServiceByUuid does not trigger any callback and does not return
+30 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
    default_team: "trendy_team_bluetooth",
}

python_test_host {
@@ -44,6 +45,35 @@ python_test_host {
    ],
}

python_test_host {
    name: "avatar_phy",
    main: "main.py",
    srcs: [
        "**/*.py",
    ],
    test_config: "AndroidPhyTest.xml",
    version: {
        py3: {
            embedded_launcher: false,
        },
    },
    libs: [
        "bumble_services_experimental-python",
        "libavatar",
    ],
    required: [
        "aapt",
    ],
    test_suites: ["general-tests"],
    test_options: {
        unit_test: false,
    },
    data: [
        ":PandoraServer",
        "config.yml",
    ],
}

sh_binary_host {
    name: "avatar.sh",
    src: "avatar.sh",
+46 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ 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
  ~
  ~      http://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.
  -->
<configuration description="Avatar tests.">
    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
        <option name="force-root" value="true"/>
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="test-file-name" value="PandoraServer.apk" />
        <option name="install-arg" value="-r" />
        <option name="install-arg" value="-g" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="run-command" value="cmd bluetooth_manager enable" />
        <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_ON" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.PythonVirtualenvPreparer">
        <option name="dep-module" value="grpcio==1.51.1" />
        <option name="dep-module" value="cryptography==35" />
        <option name="dep-module" value="numpy" />
        <option name="dep-module" value="pyusb" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
         <option name="set-property" key="persist.log.tag.bluetooth" value="VERBOSE"/>
         <option name="restore-properties" value="true"/>
    </target_preparer>
    <test class="com.android.tradefed.testtype.mobly.MoblyBinaryHostTest">
        <option name="mobly-par-file-name" value="avatar_phy" />
        <option name="mobly-config-file-name" value="config.yml" />
        <option name="mobly-test-timeout" value="1800000" />
        <option name="test-bed" value="phy" />
    </test>
</configuration>
+5 −0
Original line number Diff line number Diff line
@@ -13,3 +13,8 @@ TestBeds:
    - transport: 'tcp-client:127.0.0.1:7300'
    - transport: 'tcp-client:127.0.0.1:7300'
    - transport: 'tcp-client:127.0.0.1:7300'
- Name: phy
  Controllers:
      AndroidDevice: '*'
      BumbleDevice:
          - transport: 'pyusb:8087:0036'
Loading