annotate swap methods that require android-10

swap only works on >= android-10 anyway

closes #581 https://gitlab.com/fdroid/fdroidclient/issues/581
This commit is contained in:
Hans-Christoph Steiner 2016-02-26 22:22:10 +01:00
parent 26b35723d3
commit fd03ebd764
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package org.fdroid.fdroid.net.bluetooth; package org.fdroid.fdroid.net.bluetooth;
import android.annotation.TargetApi;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket; import android.bluetooth.BluetoothSocket;
@ -21,6 +22,7 @@ public class BluetoothClient {
device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(macAddress); device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(macAddress);
} }
@TargetApi(10)
public BluetoothConnection openConnection() throws IOException { public BluetoothConnection openConnection() throws IOException {
BluetoothSocket socket = null; BluetoothSocket socket = null;

View File

@ -1,5 +1,6 @@
package org.fdroid.fdroid.net.bluetooth; package org.fdroid.fdroid.net.bluetooth;
import android.annotation.TargetApi;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothServerSocket; import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket; import android.bluetooth.BluetoothSocket;
@ -61,6 +62,7 @@ public class BluetoothServer extends Thread {
} }
} }
@TargetApi(10)
@Override @Override
public void run() { public void run() {