Loading android/pandora/mmi2grpc/mmi2grpc/opp.py +2 −2 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ class OPPProxy(ProfileProxy): Take action to create an rfcomm channel for an OBEX connection. """ self._android.SendFile() self._android.SendFile('PTS') return "OK" Loading @@ -132,7 +132,7 @@ class OPPProxy(ProfileProxy): Take action to create an l2cap channel for an OBEX connection. """ self._android.SendFile() self._android.SendFile('PTS') return "OK" Loading android/pandora/server/src/com/android/pandora/AndroidInternal.kt +5 −10 Original line number Diff line number Diff line Loading @@ -144,18 +144,15 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable { } } override fun sendFile(request: Empty, responseObserver: StreamObserver<Empty>) { override fun sendFile(request: SendFileRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { initiateSendFile(getImageId(IMAGE_FILE_NAME), "image/bmp") waitAndSelectBluetoothDevice() waitAndSelectBluetoothDevice(request.name) Empty.getDefaultInstance() } } override fun sendPing( request: SendPingRequest, responseObserver: StreamObserver<Empty> ) { override fun sendPing(request: SendPingRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { val pingStatus = Runtime.getRuntime().exec("ping -I bt-pan -c 1 ${request.ipAddress}").waitFor() Loading @@ -163,12 +160,10 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable { } } suspend private fun waitAndSelectBluetoothDevice() { suspend private fun waitAndSelectBluetoothDevice(name: String) { var selectJob = scope.async { device .wait(Until.findObject(By.textContains("PTS")), BT_DEVICE_SELECT_WAIT_TIMEOUT) .click() device.wait(Until.findObject(By.textContains(name)), BT_DEVICE_SELECT_WAIT_TIMEOUT).click() } selectJob.await() } Loading pandora/interfaces/pandora_experimental/_android.proto +8 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ service Android { // Accept incoming file rpc AcceptIncomingFile(google.protobuf.Empty) returns (google.protobuf.Empty); // Send file rpc SendFile(google.protobuf.Empty) returns (google.protobuf.Empty); rpc SendFile(SendFileRequest) returns (google.protobuf.Empty); // Send ping rpc SendPing(SendPingRequest) returns (google.protobuf.Empty); } Loading @@ -45,6 +46,11 @@ message SetAccessPermissionRequest { AccessType access_type = 2; } message SendFileRequest { // Peer Bluetooth Device name. string name = 1; } // Internal representation of a Connection - not exposed to clients, included here // just for code-generation convenience. This is what we put in the Connection.cookie. message InternalConnectionRef { Loading Loading
android/pandora/mmi2grpc/mmi2grpc/opp.py +2 −2 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ class OPPProxy(ProfileProxy): Take action to create an rfcomm channel for an OBEX connection. """ self._android.SendFile() self._android.SendFile('PTS') return "OK" Loading @@ -132,7 +132,7 @@ class OPPProxy(ProfileProxy): Take action to create an l2cap channel for an OBEX connection. """ self._android.SendFile() self._android.SendFile('PTS') return "OK" Loading
android/pandora/server/src/com/android/pandora/AndroidInternal.kt +5 −10 Original line number Diff line number Diff line Loading @@ -144,18 +144,15 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable { } } override fun sendFile(request: Empty, responseObserver: StreamObserver<Empty>) { override fun sendFile(request: SendFileRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { initiateSendFile(getImageId(IMAGE_FILE_NAME), "image/bmp") waitAndSelectBluetoothDevice() waitAndSelectBluetoothDevice(request.name) Empty.getDefaultInstance() } } override fun sendPing( request: SendPingRequest, responseObserver: StreamObserver<Empty> ) { override fun sendPing(request: SendPingRequest, responseObserver: StreamObserver<Empty>) { grpcUnary<Empty>(scope, responseObserver) { val pingStatus = Runtime.getRuntime().exec("ping -I bt-pan -c 1 ${request.ipAddress}").waitFor() Loading @@ -163,12 +160,10 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable { } } suspend private fun waitAndSelectBluetoothDevice() { suspend private fun waitAndSelectBluetoothDevice(name: String) { var selectJob = scope.async { device .wait(Until.findObject(By.textContains("PTS")), BT_DEVICE_SELECT_WAIT_TIMEOUT) .click() device.wait(Until.findObject(By.textContains(name)), BT_DEVICE_SELECT_WAIT_TIMEOUT).click() } selectJob.await() } Loading
pandora/interfaces/pandora_experimental/_android.proto +8 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ service Android { // Accept incoming file rpc AcceptIncomingFile(google.protobuf.Empty) returns (google.protobuf.Empty); // Send file rpc SendFile(google.protobuf.Empty) returns (google.protobuf.Empty); rpc SendFile(SendFileRequest) returns (google.protobuf.Empty); // Send ping rpc SendPing(SendPingRequest) returns (google.protobuf.Empty); } Loading @@ -45,6 +46,11 @@ message SetAccessPermissionRequest { AccessType access_type = 2; } message SendFileRequest { // Peer Bluetooth Device name. string name = 1; } // Internal representation of a Connection - not exposed to clients, included here // just for code-generation convenience. This is what we put in the Connection.cookie. message InternalConnectionRef { Loading