[SB][Wifi] Save WifiEntry.level to local variable to avoid crashes.
WifiEntry.level can be changed at any time, even mid-SysUI method. WifiRepository checks the level's validity before creating a WifiNetworkModel.Active instance, and WifiNetworkModel.Active *also* checks the level's validity. This means that it's possible for the level to be valid when the repository checks it, then become invalid before we create WifiNetworkModel.Active, which then causes a crash. This CL saves the level to a local variable so that it can't change between the repo checking it and creating the model. This CL also updates WifiNetworkModel's min & max level constants to match WifiTrackerLib, now that we're fully migrated over. Fixes: 362384551 Flag: EXEMPT bugfix Test: atest WifiRepositoryImplTest WifiNetworkModelTest Change-Id: Iefcadcf4b8ca76cf96ded27f599e42966f112c94
Loading
Please register or sign in to comment