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

Skip to content
Commit 22149f3d authored by Wei Huang's avatar Wei Huang
Browse files

fix bug 2264186: clean up the outstanding async queries in ContactHeaderWidget.

- ContactHeaderWidget has cascading async queries, which weren't cancelled if a new query for a different phone number is started.
If the new query fails to find a corresponding contact, the old async queries from the previous number could end up setting the
contact name and photo to the wrong contact.

I tested this by calling

  ContactHeaderWidget.bindFromPhoneNumber(number1);
  ContactHeaderWidget.bindFromPhoneNumber(number2);

where number1 has a corresponding contact in the databse, and number2 doesn't. At the end of these 2 calls, the ContactHeaderWidget
would display the contact info for number1.

- also found a bug in AsyncQueryHandler.cancelOperation(), which doesn't reliably cancel the previous query. In ContactHeaderWidget's
case, we really depend on the cancelling to work. So work around this bug by resetting mAsyncQueryHandler when we need to do a
new lookup/query. When the old query result is passed back in the callback, discard the result if the QueryHandler is not the same
as mAsyncQueryHandler.

Change-Id: Ice79e77f787af03400e080cbd58162a91838181f
parent dcc14d6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment