paypal / paypal-here-sdk-android-distribution

Add credit card (swipe & key-in) capabilities to your Android app
Other
83 stars 95 forks source link

Bluetooth connection #201

Open Memet18 opened 2 years ago

Memet18 commented 2 years ago

The connection to the device (RP457 A) does not work in the latest versions, including v2.4.0021363000. When calling the method (searchAndConnect), it does not find the device. If you select the method of the last connected device, the device is displayed but does not connect to the device. The connection hangs, then jumps out, try again. I checked it on several devices, it does not connect at all.

EarthyOrange commented 2 years ago

@Memet18 Thanks for raising this issue. Can you please include:

Memet18 commented 2 years ago

@EarthyOrange I checked it on many devices: 1) Samsung T500 Android 11 2) Mi A2 Lite Android 10

If I build the same code but change the SDK version to the old one PUBLISH_VERSION=2.0.1.201812, then everything works. The reader can be found and i can connect to it

Debug code on version PUBLISH_VERSION = 2.4.00.2132800 (does not work):

2022-01-13 18:46:48.945 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceManager: searchAndConnectWithConfig { "shouldAutoConnect": false, "isAutoConnectInProgress": false, "scanStopped": false } 2022-01-13 18:46:48.948 14255-14954/com.paypal.paypal_sdk_for_reader_example I/PayPalRetailSDK:DeviceScanner: searchAndConnect { "currentDevice": null, "readerConfig": { "name": "[]", "address": "[]", "manufacturerName": "[]", "connectionTypeValue": "[unknown]", "shouldAutoConnect": false, "isPointingToOneReader": false } } 2022-01-13 18:46:48.952 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: Invoking searchAndConnectWithUI 2022-01-13 18:46:48.953 14255-14954/com.paypal.paypal_sdk_for_reader_example D/RetailSDKNative: scanAndDiscover 2022-01-13 18:46:49.032 14255-14255/com.paypal.paypal_sdk_for_reader_example I/DecorView: [INFO] isPopOver=false, config=true 2022-01-13 18:46:49.032 14255-14255/com.paypal.paypal_sdk_for_reader_example I/DecorView: updateCaptionType >> DecorView@83a61b[], isFloating=true, isApplication=true, hasWindowDecorCaption=false, hasWindowControllerCallback=true 2022-01-13 18:46:49.032 14255-14255/com.paypal.paypal_sdk_for_reader_example D/DecorView: setCaptionType = 0, this = DecorView@83a61b[] 2022-01-13 18:46:49.172 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: Native side added the observers so we can start scanning 2022-01-13 18:46:49.181 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: DeviceScanner started 2022-01-13 18:46:49.184 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputTransport: Input channel constructed: '99b74bd', fd=162 2022-01-13 18:46:49.184 14255-14954/com.paypal.paypal_sdk_for_reader_example D/DeviceScanner: Starting scan with ReaderConfiguration: {"name":"[]","address":"[]","manufacturerName":"[]","connectionTypeValue":"[unknown]","shouldAutoConnect":false,"isPointingToOneReader":false} 2022-01-13 18:46:49.186 14255-14954/com.paypal.paypal_sdk_for_reader_example D/DeviceScanner: Scanning for all devices 2022-01-13 18:46:49.186 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: setView = com.android.internal.policy.DecorView@83a61b TM=true 2022-01-13 18:46:49.206 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:native.ingenico.scan: scanIngenicoDevices 2022-01-13 18:46:49.229 14255-14954/com.paypal.paypal_sdk_for_reader_example D/DeviceProviders: ReaderConfig: connectionType unknown 2022-01-13 18:46:49.239 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: assignNativeObject: nativeObject = 0 Surface(name=null)/@0xbe5f7e1 / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9130 android.view.ViewRootImpl.performTraversals:3420 android.view.ViewRootImpl.doTraversal:2669 android.view.ViewRootImpl$TraversalRunnable.run:10092 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 2022-01-13 18:46:49.240 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: Relayout returned: old=(0,36,2000,1128) new=(775,529,1225,634) req=(450,105)0 dur=13 res=0x7 s={true 3555463168} ch=true fn=-1 2022-01-13 18:46:49.253 14255-14255/com.paypal.paypal_sdk_for_reader_example D/AbsListView: in onLayout changed 2022-01-13 18:46:49.254 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11078 android.view.ViewRootImpl.performTraversals:3915 android.view.ViewRootImpl.doTraversal:2669 2022-01-13 18:46:49.254 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: [DP] pd() Asnyc report 2022-01-13 18:46:49.255 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: mAttachInfo.mThreadedRenderer.draw, mView = DecorView@83a61b[DeviceConnectionActivity] w = 450 h = 105 2022-01-13 18:46:49.310 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4743 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938 2022-01-13 18:46:49.310 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: [DP] rdf() 2022-01-13 18:46:49.312 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@f46f01f[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1 2022-01-13 18:46:49.316 14255-14255/com.paypal.paypal_sdk_for_reader_example D/CommunicationManagerBase: search Devices -- 1... mode:AUDIOJACK_BLUETOOTH_USB 2022-01-13 18:46:49.354 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: getInstance(Context ctx) begin!Context=android.app.Application@33da27f 2022-01-13 18:46:49.354 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: BluetoothManager version=1.6.6.1212 2022-01-13 18:46:49.354 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: mBtCommManager == null, creat a new mBtCommManager! 2022-01-13 18:46:49.356 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: BluetoothManager version=1.6.6.1212 2022-01-13 18:46:49.375 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: phone model=SM-T500,rfCommMethod=0,SleepTime=1000,needPair=1 2022-01-13 18:46:49.375 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: creator fun--framNum = 70 2022-01-13 18:46:49.380 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_TLV: UsbManager_TLV version=1.1.6.1008 2022-01-13 18:46:49.380 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_HID: USB startDiscovery... 2022-01-13 18:46:49.381 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_API: getInstance(Context ctx) begin!Context=android.app.Application@33da27f 2022-01-13 18:46:49.382 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_API: mUsbManager=null, creat a new mUsbManager! 2022-01-13 18:46:49.384 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_usbDeviceDriver: getInstance(Context ctx) begin!Context=android.app.Application@33da27f 2022-01-13 18:46:49.384 14255-14255/com.paypal.paypal_sdk_for_reader_example I/UsbManager_usbDeviceDriver: usbDeviceDriver version=1.1.2.1008 2022-01-13 18:46:49.384 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_usbDeviceDriver: mUsbDeviceDriver == null, creat a new mUsbDeviceDriver! 2022-01-13 18:46:49.386 14255-14255/com.paypal.paypal_sdk_for_reader_example D/UsbManager_usbDeviceDriver: device counts:0 2022-01-13 18:46:49.386 14255-14255/com.paypal.paypal_sdk_for_reader_example D/CommunicationManagerBase: search Devices -- 3 2022-01-13 18:46:49.386 14255-14255/com.paypal.paypal_sdk_for_reader_example E/CommunicationManagerBase: search audioDevices... 2022-01-13 18:46:49.390 14255-14255/com.paypal.paypal_sdk_for_reader_example E/CommunicationManagerBase: isWiredHeadsetOn:false 2022-01-13 18:46:49.391 14255-14255/com.paypal.paypal_sdk_for_reader_example E/CommunicationManagerBase: search bluetoothDevices... 2022-01-13 18:46:49.391 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: getInstance(Context ctx) begin!Context=android.app.Application@33da27f 2022-01-13 18:46:49.391 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: BluetoothManager version=1.6.6.1212 2022-01-13 18:46:49.393 14255-14255/com.paypal.paypal_sdk_for_reader_example D/BluetoothCommManager: [startDiscovery|741] begin 2022-01-13 18:46:49.396 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: bondedDevice:name=PPHere-11270705,address=4C:91:57:0F:33:AD 2022-01-13 18:46:49.397 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: Receiver not registered--3-- 2022-01-13 18:46:49.499 14255-14255/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: Scanning timeout=10000 2022-01-13 18:46:49.500 14255-14255/com.paypal.paypal_sdk_for_reader_example I/BluetoothAdapter: startDiscovery 2022-01-13 18:46:49.510 14255-14255/com.paypal.paypal_sdk_for_reader_example E/BluetoothCommManager: mBluetoothAdapter.startDiscovery() failed 2022-01-13 18:46:49.512 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject s[3982422144] 2022-01-13 18:46:49.512 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject e[3982422144] 2022-01-13 18:46:49.512 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject s[3982421976] 2022-01-13 18:46:49.512 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject e[3982421976] 2022-01-13 18:46:49.512 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject s[3982421920] 2022-01-13 18:46:49.512 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject e[3982421920] 2022-01-13 18:46:49.517 14255-14255/com.paypal.paypal_sdk_for_reader_example I/ViewRootImpl@dda8173[DeviceConnectionActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1 2022-01-13 18:46:49.517 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: prepareNavigationBarInfo() DecorView@83a61b[DeviceConnectionActivity] 2022-01-13 18:46:49.518 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: getNavigationBarColor() -855310 2022-01-13 18:46:49.519 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: prepareNavigationBarInfo() DecorView@83a61b[DeviceConnectionActivity] 2022-01-13 18:46:49.519 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: getNavigationBarColor() -855310 2022-01-13 18:46:49.520 14255-14255/com.paypal.paypal_sdk_for_reader_example V/InputMethodManager: Starting input: tba=com.paypal.paypal_sdk_for_reader_example ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false 2022-01-13 18:46:49.520 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: startInputInner - Id : 0 2022-01-13 18:46:49.520 14255-14255/com.paypal.paypal_sdk_for_reader_example I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus 2022-01-13 18:46:49.522 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputTransport: Input channel constructed: 'ClientS', fd=163 2022-01-13 18:46:49.523 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputTransport: Input channel destroyed: 'ClientS', fd=94 2022-01-13 18:46:49.531 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject s[3982422200] 2022-01-13 18:46:49.531 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject e[3982422200] 2022-01-13 18:46:49.535 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject s[3487150096] 2022-01-13 18:46:49.535 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject e[3487150096] 2022-01-13 18:46:49.535 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject s[3487149984] 2022-01-13 18:46:49.535 14255-14255/com.paypal.paypal_sdk_for_reader_example I/SurfaceControl: nativeRelease nativeObject e[3487149984] 2022-01-13 18:46:59.502 14255-15017/com.paypal.paypal_sdk_for_reader_example E/BluetoothCommManager: ScanTimeoutTask--run() 2022-01-13 18:46:59.502 14255-15017/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: stopDiscovery()--begin-- 2022-01-13 18:46:59.502 14255-15017/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: sSearchState=NOTSTART 2022-01-13 18:47:18.978 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: prepareNavigationBarInfo() DecorView@83a61b[DeviceConnectionActivity] 2022-01-13 18:47:18.978 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: getNavigationBarColor() -855310 2022-01-13 18:47:18.978 14255-14255/com.paypal.paypal_sdk_for_reader_example V/InputMethodManager: Starting input: tba=com.paypal.paypal_sdk_for_reader_example ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false 2022-01-13 18:47:18.979 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputMethodManager: startInputInner - Id : 0 2022-01-13 18:47:18.979 14255-14255/com.paypal.paypal_sdk_for_reader_example I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus 2022-01-13 18:47:18.984 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputTransport: Input channel constructed: 'ClientS', fd=94 2022-01-13 18:47:18.984 14255-14255/com.paypal.paypal_sdk_for_reader_example D/InputTransport: Input channel destroyed: 'ClientS', fd=163 2022-01-13 18:47:19.179 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: Stopping native scan {} 2022-01-13 18:47:19.184 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: Stopping DeviceScanner scanning 2022-01-13 18:47:19.187 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:native.ingenico.scan: Cancelling the Ingenico Device Search 2022-01-13 18:47:19.189 14255-14954/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: getInstance() begin! 2022-01-13 18:47:19.189 14255-14954/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: BluetoothManager version=1.6.6.1212 2022-01-13 18:47:19.189 14255-14954/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: stopDiscovery()--begin-- 2022-01-13 18:47:19.189 14255-14954/com.paypal.paypal_sdk_for_reader_example W/BluetoothCommManager: sSearchState=NOTSTART 2022-01-13 18:47:19.196 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: DeviceScanner scanComplete 2022-01-13 18:47:19.199 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: DeviceScanner scanComplete callback 2022-01-13 18:47:19.202 14255-14954/com.paypal.paypal_sdk_for_reader_example D/PayPalRetailSDK:DeviceScanner: scan complete

EarthyOrange commented 2 years ago

@Memet18 I don't see the Ingenico reader being discovered in the logs at all.

Memet18 commented 2 years ago

@EarthyOrange Yes i added the location permission. Although your documentation doesn't say it. But I will repeat again, on the 2.0.1.201812 version, if nothing is changed, except for the version, the device search and connect works. But it lacks other methods that are needed to pay.

Moreover, even in your example application, search and connection does not work, and there is no check for access to the location. I was adding permission to use location myself but still the search didn't work

EarthyOrange commented 2 years ago

@Memet18 Can you please reach out to your POC at PayPal to file this issue with the PPH-SDK team? It will help us prioritize and look in to this issue at the earliest.