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

Commit b0823934 authored by Charlie Boutier's avatar Charlie Boutier
Browse files

mmi2grpc: be yapf compliant

python3 ${ANDROID_BUILD_TOP}/external/yapf/yapf -p -i mmi2grpc/*.py

Bug: 290416189
Test: atest pts-bot

Change-Id: I9f11ab60b342bac0faf19f11f97f236fcdacdfb9
parent bbb78895
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
# 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.

"""Audio tools."""

import itertools
@@ -101,7 +100,6 @@ class AudioSignal:
        index = np.where(frequency == SINE_FREQUENCY)
        amplitude = amplitudes[index][0]

        match_amplitude = math.isclose(
            amplitude, self.amplitude, rel_tol=1e-03)
        match_amplitude = math.isclose(amplitude, self.amplitude, rel_tol=1e-03)

        return match_amplitude
+5 −10
Original line number Diff line number Diff line
@@ -134,8 +134,7 @@ class GAPProxy(ProfileProxy):
            if self.counter == 0:
                self.counter += 1
                self.security_storage.DeleteBond(public=pts_addr)
                self.connection = self.host.ConnectLE(own_address_type=RANDOM,
                                                      public=pts_addr).connection
                self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection
                self.security.Secure(connection=self.connection, le=LE_LEVEL3)
                return "OK"

@@ -257,8 +256,7 @@ class GAPProxy(ProfileProxy):
        Please prepare IUT to send an advertising report with TX Power Level.
        """

        self.advertise = self.host.Advertise(own_address_type=PUBLIC,
                                             data=DataTypes(include_tx_power_level=True,))
        self.advertise = self.host.Advertise(own_address_type=PUBLIC, data=DataTypes(include_tx_power_level=True,))

        return "OK"

@@ -457,8 +455,7 @@ class GAPProxy(ProfileProxy):

        for response in self.scan_responses:
            assert response.HasField("public")
            if (response.public == pts_addr and
                    response.data.le_discoverability_mode == DISCOVERABLE_LIMITED):
            if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED):
                self.scan_responses.cancel()
                return "OK"

@@ -476,8 +473,7 @@ class GAPProxy(ProfileProxy):
            nonlocal discovered
            for response in self.scan_responses:
                assert response.HasField("public")
                if (response.public == pts_addr and
                        response.data.le_discoverability_mode == DISCOVERABLE_GENERAL):
                if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_GENERAL):
                    self.scan_responses.cancel()
                    discovered = True
                    return
@@ -503,8 +499,7 @@ class GAPProxy(ProfileProxy):
            nonlocal discovered
            for response in self.scan_responses:
                assert response.HasField("public")
                if (response.public == pts_addr and
                        response.data.le_discoverability_mode == DISCOVERABLE_LIMITED):
                if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED):
                    self.inquiry_responses.cancel()
                    discovered = True
                    return
+2 −0
Original line number Diff line number Diff line
@@ -42,8 +42,10 @@ class HOGPProxy(ProfileProxy):

        self.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection
        self.pairing_stream = self.security.OnPairing()

        def secure():
            self.security.Secure(connection=self.connection, le=LE_LEVEL3)

        threading.Thread(target=secure).start()

        return "OK"