Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b520ad21 authored by Pradeep Panigrahi's avatar Pradeep Panigrahi Committed by Linux Build Service Account
Browse files

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
parent 3a94fa0d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment