Project: titanium
Issue TIMOB-23165: Hyperloop: Android Anonymous interface implementations need to have default implementations of equals/hashCode/toString
Trying to implement BLE scanner the following error is returned: {code:java} [ERROR] : HyperloopProxy: (main) [828,2867] Exception thrown during invocation of method: public boolean android.bluetooth.BluetoothAdapter.startLeScan(android.bluetooth.BluetoothAdapter$LeScanCallback), args: [null] [ERROR] : HyperloopProxy: java.lang.NullPointerException: Expected to unbox a 'int' primitive type but was returned null [ERROR] : HyperloopProxy: at $Proxy0.hashCode(Unknown Source) [ERROR] : HyperloopProxy: at java.util.Collections.secondaryHash(Collections.java:3405) [ERROR] : HyperloopProxy: at java.util.HashMap.containsKey(HashMap.java:325) [ERROR] : HyperloopProxy: at android.bluetooth.BluetoothAdapter.startLeScan(BluetoothAdapter.java:2189) [ERROR] : HyperloopProxy: at android.bluetooth.BluetoothAdapter.startLeScan(BluetoothAdapter.java:2157) [ERROR] : HyperloopProxy: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : HyperloopProxy: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : HyperloopProxy: at hyperloop.BaseProxy.invokeMethod(BaseProxy.java:133) [ERROR] : HyperloopProxy: at hyperloop.BaseProxy.callNativeFunction(BaseProxy.java:115) [ERROR] : HyperloopProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : HyperloopProxy: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : HyperloopProxy: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:918) [ERROR] : HyperloopProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1141) [ERROR] : HyperloopProxy: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356) [ERROR] : HyperloopProxy: at ti.modules.titanium.ui.widget.listview.ListViewProxy.handleMessage(ListViewProxy.java:312) [ERROR] : HyperloopProxy: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : HyperloopProxy: at android.os.Looper.loop(Looper.java:145) [ERROR] : HyperloopProxy: at android.app.ActivityThread.main(ActivityThread.java:5951) [ERROR] : HyperloopProxy: at java.lang.reflect.Method.invoke(Native M [ERROR] : HyperloopProxy: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : HyperloopProxy: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) [ERROR] : HyperloopProxy: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) {code} and Code to reproduce: {code:java} var BluetoothManager = require('android.bluetooth.BluetoothManager'), BluetoothDevice = require('android.bluetooth.BluetoothDevice'), Context = require('android.content.Context') LeScanCallback = require('android.bluetooth.BluetoothAdapter.LeScanCallback'), Activity = require('android.app.Activity'), activity = new Activity(Ti.Android.currentActivity); var bm = BluetoothManager.cast(activity.getSystemService(Context.BLUETOOTH_SERVICE));	var bluetoothAdapter = bm.getAdapter();	console.log(bluetoothAdapter.isEnabled());	var scanCallback = new LeScanCallback({	onLeScan : function(device, rssi, data) {	console.log('startScan'); ​	}	});	bluetoothAdapter.startLeScan(scanCallback); {code}
Story points: 5