Handle file send retry scenario inside thread to avoid ANR.
Use Case: 1. Turn on BT and pair with the other device via BT. 2. Launch Contacts ->press menu -> "Import/export" -> "Share visible contacts" -> "Bluetooth" -> "select paired device". 3. Turn off BT and let the transfer fail 4. Drag down the status bar and tap the bluetooth share notification 5. Wait for a while, tap "try again" Failure: ANR occurs and "Unfortunately,Bluetooth share has stopped" error comes. Root Cause: BluetoothOppSendFileInfo::generateFileInfo() takes long time to process when there is huge contact list thereby causing ANR Fix: When tap the "try again" button on the send failed dialog, the method "BluetoothOppSendFileInfo::generateFileInfo()" will be call, if there are about 1500 contacts, then this method would be very time consuming, therby causing ANR. Changed this method into the child thread execution and through a Handler send a message to the main thread after this method return, to retry failed transfer. Change-Id: Idde7e874e4e25caba59133e0981e812b06ba2ed1
Loading
Please register or sign in to comment