summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/bluetooth/BluetoothDevice.java3
-rw-r--r--core/java/android/server/BluetoothDeviceService.java6
2 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index abf08cb..951b4b0 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -485,7 +485,8 @@ public class BluetoothDevice {
* Get the major, minor and servics classes of a remote device.
* These classes are encoded as a 32-bit integer. See BluetoothClass.
* @param address remote device
- * @return 32-bit class suitable for use with BluetoothClass.
+ * @return 32-bit class suitable for use with BluetoothClass, or
+ * BluetoothClass.ERROR on error
*/
public int getRemoteClass(String address) {
try {
diff --git a/core/java/android/server/BluetoothDeviceService.java b/core/java/android/server/BluetoothDeviceService.java
index f1a7d25..8e5cee9 100644
--- a/core/java/android/server/BluetoothDeviceService.java
+++ b/core/java/android/server/BluetoothDeviceService.java
@@ -24,6 +24,7 @@
package android.server;
+import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothHeadset;
@@ -970,8 +971,8 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub {
*/
public synchronized int getRemoteClass(String address) {
if (!BluetoothDevice.checkBluetoothAddress(address)) {
- mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
- return -1;
+ mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
+ return BluetoothClass.ERROR;
}
return getRemoteClassNative(address);
}
@@ -1254,4 +1255,3 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub {
Log.d(TAG, msg);
}
}
-