summaryrefslogtreecommitdiff
path: root/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java b/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
index f5f4fe4f88fb..53d85d86378f 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
@@ -8,13 +8,15 @@
*/
package org.libreoffice.impressremote.communication;
+import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.os.Build;
-import org.libreoffice.impressremote.util.BluetoothOperator;
import org.libreoffice.impressremote.util.Preferences;
final class PairingProvider {
+ private static final BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
+
private final Preferences mAuthorizedServersPreferences;
private PairingProvider(Context aContext) {
@@ -58,15 +60,11 @@ final class PairingProvider {
}
private String getPairingDeviceName() {
- if (!BluetoothOperator.isAvailable()) {
- return Build.MODEL;
- }
-
- if (BluetoothOperator.getAdapter().getName() == null) {
+ if (btAdapter == null || btAdapter.getName() == null) {
return Build.MODEL;
}
- return BluetoothOperator.getAdapter().getName();
+ return btAdapter.getName();
}
}