summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-02-13 02:07:27 +0200
committerTor Lillqvist <tml@iki.fi>2013-02-13 02:14:57 +0200
commit2244bb1467454614140bc71af7395d0129e27bc3 (patch)
treeab36a016a787eb3061f7ecd73a9afb1ef4aa3f0d /android
parentb3729421aead56f598b68cd2069c7b33b40e330c (diff)
Add comments, logging, empty lines
Change-Id: Ife81ec74b36f71782997219e36ac926ea429c297
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java2
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java6
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/Server.java3
3 files changed, 11 insertions, 0 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
index 207aef7613ec..1b8c044fcc06 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
@@ -183,6 +183,8 @@ public class SelectorActivity extends SherlockActivity {
}
void doBindService() {
+ // This is what creates the first (only?) CommunicationService instance
+ // and calls its run() method (in another thread).
Intent aIntent = new Intent(this, CommunicationService.class);
startService(aIntent);
bindService(aIntent, mConnection, Context.BIND_IMPORTANT);
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java
index 49be8a3deaab..07a626f3803e 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java
@@ -36,6 +36,9 @@ public class BluetoothClient extends Client {
Receiver aReceiver, boolean aBluetoothWasEnabled)
throws IOException {
super(aServer, aCommunicationService, aReceiver);
+
+ Log.i(Globals.TAG, "BluetoothClient(" + aServer + ")");
+
mAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothWasEnabled = aBluetoothWasEnabled;
if (!mBluetoothWasEnabled) {
@@ -45,18 +48,21 @@ public class BluetoothClient extends Client {
BluetoothDevice aDevice = mAdapter
.getRemoteDevice(aServer.getAddress());
mAdapter.cancelDiscovery();
+
// This is the "standard UUID for the Serial Port Profile".
// I.e. the 16-bit SerialPort UUID 0x1101 inserted into the
// Bluetooth BASE_UUID. See
// https://www.bluetooth.org/Technical/AssignedNumbers/service_discovery.htm
mSocket = aDevice.createRfcommSocketToServiceRecord(UUID
.fromString("00001101-0000-1000-8000-00805F9B34FB"));
+
mSocket.connect();
Log.i(Globals.TAG, "BluetoothClient: connected");
mInputStream = mSocket.getInputStream();
mReader = new BufferedReader(new InputStreamReader(mInputStream,
CHARSET));
+
mOutputStream = mSocket.getOutputStream();
String aTemp = mReader.readLine();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
index a09cc6ae2e1e..82172beb427b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
@@ -53,6 +53,9 @@ public class Server {
return mTimeDiscovered;
}
+ public String toString() {
+ return getClass().getName() + '@' + Integer.toHexString(hashCode()) + ":{" + mAddress + "," + mName + "}";
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */