Loading jni/com_android_bluetooth_hidd.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -347,8 +347,6 @@ static jboolean unregisterAppNative(JNIEnv* env, jobject thiz) { static jboolean sendReportNative(JNIEnv* env, jobject thiz, jint id, jbyteArray data) { ALOGV("%s enter", __FUNCTION__); jboolean result = JNI_FALSE; jsize size; uint8_t* buf; Loading @@ -362,8 +360,6 @@ static jboolean sendReportNative(JNIEnv* env, jobject thiz, jint id, bt_status_t ret = sHiddIf->send_report(BTHD_REPORT_TYPE_INTRDATA, id, size, buf); ALOGV("%s: send_report() returned %d", __FUNCTION__, ret); if (ret == BT_STATUS_SUCCESS) { result = JNI_TRUE; } Loading @@ -371,8 +367,6 @@ static jboolean sendReportNative(JNIEnv* env, jobject thiz, jint id, free(buf); } ALOGV("%s done (%d)", __FUNCTION__, result); return result; } Loading src/com/android/bluetooth/hid/HidDevService.java +169 −170 Original line number Diff line number Diff line Loading @@ -42,8 +42,7 @@ import java.util.NoSuchElementException; /** @hide */ public class HidDevService extends ProfileService { private static final boolean DBG = true; private static final boolean DBG = false; private static final String TAG = HidDevService.class.getSimpleName(); Loading @@ -67,19 +66,19 @@ public class HidDevService extends ProfileService { private BluetoothHidDeviceDeathRecipient mDeathRcpt; static { classInitNative(); } static { classInitNative(); } private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { if (DBG) Log.v(TAG, "handleMessage(): msg.what=" + msg.what); if (DBG) Log.v(TAG, "handleMessage(): msg.what=" + msg.what); switch (msg.what) { case MESSAGE_APPLICATION_STATE_CHANGED: { BluetoothDevice device = msg.obj != null ? getDevice((byte[])msg.obj) : null; BluetoothDevice device = msg.obj != null ? getDevice((byte[]) msg.obj) : null; boolean success = (msg.arg1 != 0); if (success) { Loading @@ -99,8 +98,8 @@ public class HidDevService extends ProfileService { } if (success) { mDeathRcpt = new BluetoothHidDeviceDeathRecipient(HidDevService.this, mAppConfig); mDeathRcpt = new BluetoothHidDeviceDeathRecipient( HidDevService.this, mAppConfig); if (mCallback != null) { IBinder binder = mCallback.asBinder(); try { Loading Loading @@ -144,8 +143,7 @@ public class HidDevService extends ProfileService { broadcastConnectionState(device, state); try { if (mCallback != null) mCallback.onConnectionStateChanged(device, state); if (mCallback != null) mCallback.onConnectionStateChanged(device, state); } catch (RemoteException e) { e.printStackTrace(); } Loading @@ -158,7 +156,8 @@ public class HidDevService extends ProfileService { int bufferSize = msg.obj == null ? 0 : ((Integer) msg.obj).intValue(); try { if (mCallback != null) mCallback.onGetReport(mHidDevice, type, id, bufferSize); if (mCallback != null) mCallback.onGetReport(mHidDevice, type, id, bufferSize); } catch (RemoteException e) { e.printStackTrace(); } Loading @@ -170,7 +169,8 @@ public class HidDevService extends ProfileService { byte[] data = ((ByteBuffer) msg.obj).array(); try { if (mCallback != null) mCallback.onSetReport(mHidDevice, reportType, reportId, data); if (mCallback != null) mCallback.onSetReport(mHidDevice, reportType, reportId, data); } catch (RemoteException e) { e.printStackTrace(); } Loading Loading @@ -210,8 +210,7 @@ public class HidDevService extends ProfileService { } }; private static class BluetoothHidDeviceDeathRecipient implements IBinder.DeathRecipient { private static class BluetoothHidDeviceDeathRecipient implements IBinder.DeathRecipient { private HidDevService mService; private BluetoothHidDeviceAppConfiguration mAppConfig; Loading Loading
jni/com_android_bluetooth_hidd.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -347,8 +347,6 @@ static jboolean unregisterAppNative(JNIEnv* env, jobject thiz) { static jboolean sendReportNative(JNIEnv* env, jobject thiz, jint id, jbyteArray data) { ALOGV("%s enter", __FUNCTION__); jboolean result = JNI_FALSE; jsize size; uint8_t* buf; Loading @@ -362,8 +360,6 @@ static jboolean sendReportNative(JNIEnv* env, jobject thiz, jint id, bt_status_t ret = sHiddIf->send_report(BTHD_REPORT_TYPE_INTRDATA, id, size, buf); ALOGV("%s: send_report() returned %d", __FUNCTION__, ret); if (ret == BT_STATUS_SUCCESS) { result = JNI_TRUE; } Loading @@ -371,8 +367,6 @@ static jboolean sendReportNative(JNIEnv* env, jobject thiz, jint id, free(buf); } ALOGV("%s done (%d)", __FUNCTION__, result); return result; } Loading
src/com/android/bluetooth/hid/HidDevService.java +169 −170 Original line number Diff line number Diff line Loading @@ -42,8 +42,7 @@ import java.util.NoSuchElementException; /** @hide */ public class HidDevService extends ProfileService { private static final boolean DBG = true; private static final boolean DBG = false; private static final String TAG = HidDevService.class.getSimpleName(); Loading @@ -67,19 +66,19 @@ public class HidDevService extends ProfileService { private BluetoothHidDeviceDeathRecipient mDeathRcpt; static { classInitNative(); } static { classInitNative(); } private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { if (DBG) Log.v(TAG, "handleMessage(): msg.what=" + msg.what); if (DBG) Log.v(TAG, "handleMessage(): msg.what=" + msg.what); switch (msg.what) { case MESSAGE_APPLICATION_STATE_CHANGED: { BluetoothDevice device = msg.obj != null ? getDevice((byte[])msg.obj) : null; BluetoothDevice device = msg.obj != null ? getDevice((byte[]) msg.obj) : null; boolean success = (msg.arg1 != 0); if (success) { Loading @@ -99,8 +98,8 @@ public class HidDevService extends ProfileService { } if (success) { mDeathRcpt = new BluetoothHidDeviceDeathRecipient(HidDevService.this, mAppConfig); mDeathRcpt = new BluetoothHidDeviceDeathRecipient( HidDevService.this, mAppConfig); if (mCallback != null) { IBinder binder = mCallback.asBinder(); try { Loading Loading @@ -144,8 +143,7 @@ public class HidDevService extends ProfileService { broadcastConnectionState(device, state); try { if (mCallback != null) mCallback.onConnectionStateChanged(device, state); if (mCallback != null) mCallback.onConnectionStateChanged(device, state); } catch (RemoteException e) { e.printStackTrace(); } Loading @@ -158,7 +156,8 @@ public class HidDevService extends ProfileService { int bufferSize = msg.obj == null ? 0 : ((Integer) msg.obj).intValue(); try { if (mCallback != null) mCallback.onGetReport(mHidDevice, type, id, bufferSize); if (mCallback != null) mCallback.onGetReport(mHidDevice, type, id, bufferSize); } catch (RemoteException e) { e.printStackTrace(); } Loading @@ -170,7 +169,8 @@ public class HidDevService extends ProfileService { byte[] data = ((ByteBuffer) msg.obj).array(); try { if (mCallback != null) mCallback.onSetReport(mHidDevice, reportType, reportId, data); if (mCallback != null) mCallback.onSetReport(mHidDevice, reportType, reportId, data); } catch (RemoteException e) { e.printStackTrace(); } Loading Loading @@ -210,8 +210,7 @@ public class HidDevService extends ProfileService { } }; private static class BluetoothHidDeviceDeathRecipient implements IBinder.DeathRecipient { private static class BluetoothHidDeviceDeathRecipient implements IBinder.DeathRecipient { private HidDevService mService; private BluetoothHidDeviceAppConfiguration mAppConfig; Loading