Loading android/pandora/mmi2grpc/mmi2grpc/__init__.py +8 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ from mmi2grpc.hid import HIDProxy from mmi2grpc.hogp import HOGPProxy from mmi2grpc.l2cap import L2CAPProxy from mmi2grpc.map import MAPProxy from mmi2grpc.opp import OPPProxy from mmi2grpc.pbap import PBAPProxy from mmi2grpc.rfcomm import RFCOMMProxy from mmi2grpc.sdp import SDPProxy Loading Loading @@ -80,6 +81,7 @@ class IUT: self._hogp = None self._l2cap = None self._map = None self._opp = None self._pbap = None self._rfcomm = None self._sdp = None Loading Loading @@ -113,6 +115,7 @@ class IUT: self._hid = None self._hogp = None self._map = None self._opp = None self._pbap = None self._rfcomm = None self._sdp = None Loading Loading @@ -232,6 +235,11 @@ class IUT: if not self._map: self._map = MAPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}")) return self._map.interact(test, interaction, description, pts_address) # Handles OPP MMIs. if profile in ("OPP"): if not self._opp: self._opp = OPPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}")) return self._opp.interact(test, interaction, description, pts_address) # Instantiates PBAP proxy and reroutes corresponding MMIs to it. if profile in ("PBAP"): if not self._pbap: Loading android/pandora/mmi2grpc/mmi2grpc/opp.py 0 → 100644 +118 −0 Original line number Diff line number Diff line # Copyright 2022 Google LLC # # 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 # # https://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. """OPP proxy module.""" from typing import Optional from mmi2grpc._helpers import assert_description from mmi2grpc._proxy import ProfileProxy from pandora_experimental.host_grpc import Host from pandora_experimental.host_pb2 import Connection from pandora_experimental._android_grpc import Android from pandora_experimental._android_pb2 import AccessType class OPPProxy(ProfileProxy): """OPP proxy. Implements OPP PTS MMIs. """ connection: Optional[Connection] = None def __init__(self, channel): super().__init__(channel) self.host = Host(channel) self._android = Android(channel) self.connection = None @assert_description def TSC_OBEX_MMI_iut_accept_connect_OPP(self, pts_addr: bytes, **kwargs): """ Please accept the OBEX CONNECT REQ command for OPP. """ if self.connection is None: self.connection = self.host.WaitConnection(address=pts_addr).connection return "OK" @assert_description def TSC_OPP_mmi_user_action_remove_object(self, **kwargs): """ If necessary take action to remove any file(s) named 'BC_BV01.bmp' from the IUT. Press 'OK' to confirm that the file is not present on the IUT. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_put(self, **kwargs): """ Please accept the PUT REQUEST. """ self._android.AcceptIncomingFile() return "OK" @assert_description def TSC_OPP_mmi_user_verify_does_object_exist(self, **kwargs): """ Does the IUT now contain the following files? BC_BV01.bmp Note: If TSPX_supported_extension is not .bmp, the file content of the file will not be formatted for the TSPX_supported extension, this is normal. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_slc_connect_l2cap(self, pts_addr: bytes, **kwargs): """ Please accept the l2cap channel connection for an OBEX connection. """ self.connection = self.host.WaitConnection(address=pts_addr).connection return "OK" @assert_description def TSC_OBEX_MMI_iut_reject_action(self, **kwargs): """ Take action to reject the ACTION command sent by PTS. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_disconnect(self, **kwargs): """ Please accept the OBEX DISCONNECT REQ command. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_slc_disconnect(self, **kwargs): """ Please accept the disconnection of the transport channel. """ return "OK" android/pandora/server/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ java_library_static { static_libs: [ "androidx.test.runner", "androidx.test.core", "androidx.test.uiautomator_uiautomator", "grpc-java-netty-shaded-test", "grpc-java-lite", "guava", Loading android/pandora/server/configs/PtsBotTest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ <option name="profile" value="L2CAP/COS" /> <option name="profile" value="L2CAP/LE" /> <option name="profile" value="MAP" /> <option name="profile" value="OPP" /> <option name="profile" value="PBAP/PSE" /> <option name="profile" value="RFCOMM" /> <option name="profile" value="SDP" /> Loading android/pandora/server/configs/PtsBotTestMts.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ <option name="profile" value="L2CAP/COS" /> <option name="profile" value="L2CAP/LE" /> <option name="profile" value="MAP" /> <option name="profile" value="OPP" /> <option name="profile" value="PBAP/PSE" /> <option name="profile" value="RFCOMM" /> <option name="profile" value="SDP" /> Loading Loading
android/pandora/mmi2grpc/mmi2grpc/__init__.py +8 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ from mmi2grpc.hid import HIDProxy from mmi2grpc.hogp import HOGPProxy from mmi2grpc.l2cap import L2CAPProxy from mmi2grpc.map import MAPProxy from mmi2grpc.opp import OPPProxy from mmi2grpc.pbap import PBAPProxy from mmi2grpc.rfcomm import RFCOMMProxy from mmi2grpc.sdp import SDPProxy Loading Loading @@ -80,6 +81,7 @@ class IUT: self._hogp = None self._l2cap = None self._map = None self._opp = None self._pbap = None self._rfcomm = None self._sdp = None Loading Loading @@ -113,6 +115,7 @@ class IUT: self._hid = None self._hogp = None self._map = None self._opp = None self._pbap = None self._rfcomm = None self._sdp = None Loading Loading @@ -232,6 +235,11 @@ class IUT: if not self._map: self._map = MAPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}")) return self._map.interact(test, interaction, description, pts_address) # Handles OPP MMIs. if profile in ("OPP"): if not self._opp: self._opp = OPPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}")) return self._opp.interact(test, interaction, description, pts_address) # Instantiates PBAP proxy and reroutes corresponding MMIs to it. if profile in ("PBAP"): if not self._pbap: Loading
android/pandora/mmi2grpc/mmi2grpc/opp.py 0 → 100644 +118 −0 Original line number Diff line number Diff line # Copyright 2022 Google LLC # # 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 # # https://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. """OPP proxy module.""" from typing import Optional from mmi2grpc._helpers import assert_description from mmi2grpc._proxy import ProfileProxy from pandora_experimental.host_grpc import Host from pandora_experimental.host_pb2 import Connection from pandora_experimental._android_grpc import Android from pandora_experimental._android_pb2 import AccessType class OPPProxy(ProfileProxy): """OPP proxy. Implements OPP PTS MMIs. """ connection: Optional[Connection] = None def __init__(self, channel): super().__init__(channel) self.host = Host(channel) self._android = Android(channel) self.connection = None @assert_description def TSC_OBEX_MMI_iut_accept_connect_OPP(self, pts_addr: bytes, **kwargs): """ Please accept the OBEX CONNECT REQ command for OPP. """ if self.connection is None: self.connection = self.host.WaitConnection(address=pts_addr).connection return "OK" @assert_description def TSC_OPP_mmi_user_action_remove_object(self, **kwargs): """ If necessary take action to remove any file(s) named 'BC_BV01.bmp' from the IUT. Press 'OK' to confirm that the file is not present on the IUT. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_put(self, **kwargs): """ Please accept the PUT REQUEST. """ self._android.AcceptIncomingFile() return "OK" @assert_description def TSC_OPP_mmi_user_verify_does_object_exist(self, **kwargs): """ Does the IUT now contain the following files? BC_BV01.bmp Note: If TSPX_supported_extension is not .bmp, the file content of the file will not be formatted for the TSPX_supported extension, this is normal. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_slc_connect_l2cap(self, pts_addr: bytes, **kwargs): """ Please accept the l2cap channel connection for an OBEX connection. """ self.connection = self.host.WaitConnection(address=pts_addr).connection return "OK" @assert_description def TSC_OBEX_MMI_iut_reject_action(self, **kwargs): """ Take action to reject the ACTION command sent by PTS. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_disconnect(self, **kwargs): """ Please accept the OBEX DISCONNECT REQ command. """ return "OK" @assert_description def TSC_OBEX_MMI_iut_accept_slc_disconnect(self, **kwargs): """ Please accept the disconnection of the transport channel. """ return "OK"
android/pandora/server/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ java_library_static { static_libs: [ "androidx.test.runner", "androidx.test.core", "androidx.test.uiautomator_uiautomator", "grpc-java-netty-shaded-test", "grpc-java-lite", "guava", Loading
android/pandora/server/configs/PtsBotTest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ <option name="profile" value="L2CAP/COS" /> <option name="profile" value="L2CAP/LE" /> <option name="profile" value="MAP" /> <option name="profile" value="OPP" /> <option name="profile" value="PBAP/PSE" /> <option name="profile" value="RFCOMM" /> <option name="profile" value="SDP" /> Loading
android/pandora/server/configs/PtsBotTestMts.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ <option name="profile" value="L2CAP/COS" /> <option name="profile" value="L2CAP/LE" /> <option name="profile" value="MAP" /> <option name="profile" value="OPP" /> <option name="profile" value="PBAP/PSE" /> <option name="profile" value="RFCOMM" /> <option name="profile" value="SDP" /> Loading