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 Original line Diff line number Diff line
@@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.

"""Audio tools."""
"""Audio tools."""


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


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


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


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


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


        return "OK"
        return "OK"


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


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


@@ -476,8 +473,7 @@ class GAPProxy(ProfileProxy):
            nonlocal discovered
            nonlocal discovered
            for response in self.scan_responses:
            for response in self.scan_responses:
                assert response.HasField("public")
                assert response.HasField("public")
                if (response.public == pts_addr and
                if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_GENERAL):
                        response.data.le_discoverability_mode == DISCOVERABLE_GENERAL):
                    self.scan_responses.cancel()
                    self.scan_responses.cancel()
                    discovered = True
                    discovered = True
                    return
                    return
@@ -503,8 +499,7 @@ class GAPProxy(ProfileProxy):
            nonlocal discovered
            nonlocal discovered
            for response in self.scan_responses:
            for response in self.scan_responses:
                assert response.HasField("public")
                assert response.HasField("public")
                if (response.public == pts_addr and
                if (response.public == pts_addr and response.data.le_discoverability_mode == DISCOVERABLE_LIMITED):
                        response.data.le_discoverability_mode == DISCOVERABLE_LIMITED):
                    self.inquiry_responses.cancel()
                    self.inquiry_responses.cancel()
                    discovered = True
                    discovered = True
                    return
                    return
+2 −0
Original line number Original line 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.connection = self.host.ConnectLE(own_address_type=RANDOM, public=pts_addr).connection
        self.pairing_stream = self.security.OnPairing()
        self.pairing_stream = self.security.OnPairing()

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

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


        return "OK"
        return "OK"