Merge "ignore invlaid play position update from remote control client." into jb-mr2-dev
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 11c19fc..f6dde86 100644
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -91,17 +91,6 @@
jobjectArray *props) {
jbyteArray propVal;
for (int i = 0; i < num_properties; i++) {
-
- /* The higher layers expect rssi as a short int value, while the value is sent as a byte
- * to jni. Converting rssi value to the expected format.*/
- if (properties[i].type == BT_PROPERTY_REMOTE_RSSI)
- {
- jbyte rssi = *((jbyte *) properties[i].val);
- short rssiValue = rssi;
- properties[i].len = sizeof(rssiValue);
- properties[i].val = &rssiValue;
- }
-
propVal = callbackEnv->NewByteArray(properties[i].len);
if (propVal == NULL) goto Fail;
diff --git a/src/com/android/bluetooth/btservice/AdapterState.java b/src/com/android/bluetooth/btservice/AdapterState.java
index 5f3d485..5f9c30b 100755
--- a/src/com/android/bluetooth/btservice/AdapterState.java
+++ b/src/com/android/bluetooth/btservice/AdapterState.java
@@ -345,6 +345,7 @@
errorLog("Error disabling Bluetooth");
mPendingCommandState.setTurningOff(false);
transitionTo(mOnState);
+ notifyAdapterStateChange(BluetoothAdapter.STATE_ON);
break;
default:
if (DBG) Log.d(TAG,"ERROR: UNEXPECTED MESSAGE: CURRENT_STATE=PENDING, MESSAGE = " + msg.what );
diff --git a/src/com/android/bluetooth/btservice/RemoteDevices.java b/src/com/android/bluetooth/btservice/RemoteDevices.java
index 04bc1c2..a60f977 100755
--- a/src/com/android/bluetooth/btservice/RemoteDevices.java
+++ b/src/com/android/bluetooth/btservice/RemoteDevices.java
@@ -294,7 +294,8 @@
device.mDeviceType = Utils.byteArrayToInt(val);
break;
case AbstractionLayer.BT_PROPERTY_REMOTE_RSSI:
- device.mRssi = Utils.byteArrayToShort(val);
+ // RSSI from hal is in one byte
+ device.mRssi = val[0];
break;
}
}