summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothPan.java
diff options
context:
space:
mode:
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothPan.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothPan.java23
1 files changed, 4 insertions, 19 deletions
diff --git a/framework/java/android/bluetooth/BluetoothPan.java b/framework/java/android/bluetooth/BluetoothPan.java
index 7af770e69e..a80f5b7f36 100644
--- a/framework/java/android/bluetooth/BluetoothPan.java
+++ b/framework/java/android/bluetooth/BluetoothPan.java
@@ -19,7 +19,6 @@ package android.bluetooth;
import android.Manifest;
import android.annotation.IntDef;
import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
@@ -30,7 +29,6 @@ import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
-import android.util.CloseGuard;
import android.util.Log;
import java.lang.annotation.Retention;
@@ -51,11 +49,10 @@ import java.util.List;
* @hide
*/
@SystemApi
-public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
+public final class BluetoothPan implements BluetoothProfile {
private static final String TAG = "BluetoothPan";
private static final boolean DBG = true;
private static final boolean VDBG = false;
- private CloseGuard mCloseGuard;
/**
* Intent used to broadcast the change in connection state of the Pan
@@ -168,16 +165,13 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
mAdapter = BluetoothAdapter.getDefaultAdapter();
mContext = context;
mProfileConnector.connect(context, listener);
- mCloseGuard = new CloseGuard();
- mCloseGuard.open("close");
}
/**
* Closes the connection to the service and unregisters callbacks
- *
- * @hide
*/
- public void close() {
+ @UnsupportedAppUsage
+ void close() {
if (VDBG) log("close()");
mProfileConnector.disconnect();
}
@@ -188,9 +182,6 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
/** @hide */
protected void finalize() {
- if (mCloseGuard != null) {
- mCloseGuard.warnIfOpen();
- }
close();
}
@@ -204,9 +195,6 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
* the state. Users can get the connection state of the profile
* from this intent.
*
- * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}
- * permission.
- *
* @param device Remote Bluetooth Device
* @return false on immediate error, true otherwise
* @hide
@@ -245,9 +233,6 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
* {@link #STATE_DISCONNECTING} can be used to distinguish between the
* two scenarios.
*
- * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}
- * permission.
- *
* @param device Remote Bluetooth Device
* @return false on immediate error, true otherwise
* @hide
@@ -353,7 +338,7 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
@SystemApi
@Override
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
- public int getConnectionState(@Nullable BluetoothDevice device) {
+ public int getConnectionState(@NonNull BluetoothDevice device) {
if (VDBG) log("getState(" + device + ")");
final IBluetoothPan service = getService();
if (service != null && isEnabled() && isValidDevice(device)) {