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

Skip to content
Commit 088215d8 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Wifi details: minor ordering fixes.

1. Set mNetwork before the NetworkCallbacks can be delivered.
   Previously, the code would set mNetwork in updateInfo, relying
   on the fact that the BroadcastReceiver registered in onResume
   is immediately invoked. However, this races with the
   callbacks, which are also immediately invoked. If the
   callbacks won the race, mNetwork would not be set and they
   would be ignored.

2. Call updateInfo in onResume instead of in displayPreference.
   This ensures that it's always called exactly once before the
   activity starts running, regardless of whether it's being
   displayed the first time (i.e., after onStart) or resumed
   by switching from another app. displayPreference is only
   called in the former case.

3. Don't call getLinkProperties and getNetworkCapabilities in
   updateInfo. These calls are superfluous, because this
   information is update by the NetworkCallbacks, and they can
   cause jank because updateInfo is called on the UI thread.

This requires that the tests be changed so they always call
onResume, since no UI elements are populated until onResume is
called.

Bug: 62209358
Test: make -j64 RunSettingsRoboTests
Change-Id: Iccb1b9ae51188755d890a6df83004dbe9bec565e
parent 2561df80
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