1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.nearby.fastpair.provider.simulator.testing; 18 19 /** Represents a remote device and provides a {@link StreamIOHandler} to communicate with it. */ 20 public class RemoteDevice { 21 private final String mId; 22 private final StreamIOHandler mStreamIOHandler; 23 private final InputStreamListener mInputStreamListener; 24 RemoteDevice( String id, StreamIOHandler streamIOHandler, InputStreamListener inputStreamListener)25 public RemoteDevice( 26 String id, StreamIOHandler streamIOHandler, InputStreamListener inputStreamListener) { 27 this.mId = id; 28 this.mStreamIOHandler = streamIOHandler; 29 this.mInputStreamListener = inputStreamListener; 30 } 31 32 /** The id used by this device. */ getId()33 public String getId() { 34 return mId; 35 } 36 37 /** The handler processes input and output data channels. */ getStreamIOHandler()38 public StreamIOHandler getStreamIOHandler() { 39 return mStreamIOHandler; 40 } 41 42 /** Listener for the input stream. */ getInputStreamListener()43 public InputStreamListener getInputStreamListener() { 44 return mInputStreamListener; 45 } 46 } 47