Skip to content
Commit ce6bab87 authored by Sundeep Ghuman's avatar Sundeep Ghuman
Browse files

Use synchronization rather than locking in WifiTracker.

This vastly simplifies WifiTracker usage. The existing locking behavior
closed a lock on thread A, depended on thread B to open it, and would
block on Thread A until thread B did. However, thread B can also block
on this lock, hence if Thread A closes the lock between thread B opening
it and blocking on it, and deadlock would result in an ANR that would
crash WifiSettings (see b/37530557 for another example).

All work on the WorkHandler is now synchronized, as a preliminary step
to removing the worker thread altogether, pending discussions with original
author on the threads creation.

Also fix test flakiness, an indirect byproduct of now simplifying concurrency
issues in this class. Fixes b/37581732.

Together with the other changes in this topic, this CL resolves all known
wifi picker jank and no ANRs have been witnessed.

Bug: b/37504190
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java

Change-Id: I0e47a4d50372beb2d141189276b1a4d9230c0d98
parent 71f4a82b
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