summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-20 12:10:12 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-20 12:10:50 +0200
commit661b032902147a81f7557afac759880e7dadec11 (patch)
tree83561173bff7f8c06a6c9992f84f8bfdc5171288 /android
parentRevert "fdo#53175: docx export, close hyperlinks before fields" (diff)
downloadcore-661b032902147a81f7557afac759880e7dadec11.tar.gz
core-661b032902147a81f7557afac759880e7dadec11.zip
Prevent deadlock on pairing.
Change-Id: I1c746861e1e5c6625e03f4761ecf2fd641fcf071
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/res/layout/fragment_blankscreen.xml2
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java6
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java18
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java2
4 files changed, 11 insertions, 17 deletions
diff --git a/android/sdremote/res/layout/fragment_blankscreen.xml b/android/sdremote/res/layout/fragment_blankscreen.xml
index cf287ba1220a..87ecf0347ec8 100644
--- a/android/sdremote/res/layout/fragment_blankscreen.xml
+++ b/android/sdremote/res/layout/fragment_blankscreen.xml
@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dip"
- android:gravity="left"
+ android:gravity="center_vertical"
android:orientation="vertical" >
<ImageView
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java
index bfe10a9fefb3..d93ea5ce0b1c 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java
@@ -40,7 +40,11 @@ public class BluetoothFinder {
public void stopFinding() {
mAdapter.cancelDiscovery();
- mContext.unregisterReceiver(mReceiver);
+ try {
+ mContext.unregisterReceiver(mReceiver);
+ } catch (IllegalArgumentException e) {
+ // The receiver wasn't registered
+ }
}
private HashMap<String, Server> mServerList = new HashMap<String, Server>();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index b25fcc04b49b..efa65146d651 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -85,23 +85,13 @@ public class CommunicationService extends Service implements Runnable {
}
public void startSearching() {
- synchronized (mConnectionVariableMutex) {
- if (mState == State.CONNECTING || mState == State.CONNECTED) {
- disconnect();
- }
- mNetworkFinder.startFinding();
- mBluetoothFinder.startFinding();
- mState = State.SEARCHING;
- }
- new BluetoothFinder(this);
+ mNetworkFinder.startFinding();
+ mBluetoothFinder.startFinding();
}
public void stopSearching() {
- synchronized (mConnectionVariableMutex) {
- mNetworkFinder.stopFinding();
- mBluetoothFinder.stopFinding();
- mState = State.DISCONNECTED;
- }
+ mNetworkFinder.stopFinding();
+ mBluetoothFinder.stopFinding();
}
public void connectTo(Server aServer) {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
index 67a886223f3d..c88d018bcabe 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
@@ -63,7 +63,7 @@ public class ServerFinder {
return;
}
Server aServer = new Server(Server.Protocol.NETWORK, aPacket
- .getAddress().toString(), aName,
+ .getAddress().getHostAddress(), aName,
System.currentTimeMillis());
mServerList.put(aServer.getAddress(), aServer);