summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2013-07-18 18:18:36 -0700
committerZhihai Xu <zhihaixu@google.com>2013-08-09 18:44:53 -0700
commitfd6603b8bf9ed72dcc8bd59aaef3209251b6e17c (patch)
treefecaf3c95adce97dc5176cc341d903fe488d5edf /src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java
parentbb1ac417208c8e283f9b5b49f4413856500ed0f9 (diff)
downloadandroid_packages_apps_Bluetooth-fd6603b8bf9ed72dcc8bd59aaef3209251b6e17c.tar.gz
android_packages_apps_Bluetooth-fd6603b8bf9ed72dcc8bd59aaef3209251b6e17c.tar.bz2
android_packages_apps_Bluetooth-fd6603b8bf9ed72dcc8bd59aaef3209251b6e17c.zip
Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530 Change-Id: If9ce878d71c1e1b12416014c433da03b3033e158
Diffstat (limited to 'src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java')
-rw-r--r--src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java b/src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java
new file mode 100644
index 000000000..fc5d54a5d
--- /dev/null
+++ b/src/com/android/bluetooth/map/BluetoothMnsRfcommTransport.java
@@ -0,0 +1,79 @@
+/*
+* Copyright (C) 2013 Samsung System LSI
+* 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
+*
+* http://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.
+*/
+package com.android.bluetooth.map;
+
+import android.bluetooth.BluetoothSocket;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.obex.ObexTransport;
+
+public class BluetoothMnsRfcommTransport implements ObexTransport {
+
+ private final BluetoothSocket mSocket;
+
+ public BluetoothMnsRfcommTransport(BluetoothSocket socket) {
+ super();
+ this.mSocket = socket;
+ }
+
+ public void close() throws IOException {
+ mSocket.close();
+ }
+
+ public DataInputStream openDataInputStream() throws IOException {
+ return new DataInputStream(openInputStream());
+ }
+
+ public DataOutputStream openDataOutputStream() throws IOException {
+ return new DataOutputStream(openOutputStream());
+ }
+
+ public InputStream openInputStream() throws IOException {
+ return mSocket.getInputStream();
+ }
+
+ public OutputStream openOutputStream() throws IOException {
+ return mSocket.getOutputStream();
+ }
+
+ public void connect() throws IOException {
+ }
+
+ public void create() throws IOException {
+ }
+
+ public void disconnect() throws IOException {
+ }
+
+ public void listen() throws IOException {
+ }
+
+ public boolean isConnected() throws IOException {
+ // TODO: add implementation
+ return true;
+ }
+
+ public String getRemoteAddress() {
+ if (mSocket == null)
+ return null;
+ return mSocket.getRemoteDevice().getAddress();
+ }
+
+}