Loading
DataConnection fix race condition due to mApnSetting
The race condition occurs when DataConnection calls clearSettings on the DC thread while the main thread calls toStringSimple on the main thread. DC#clearSettings sets mApnSetting to null, and toStringSimple calls getNetworkCapabilities, which checks whether mApnSetting is null or not. Fix the race condition by making both clearSettings and toStringSimple synchronized, so mApnSetting will be set to null and toStringSimple will run afterwards instead of at the same time. Test: atest DataConnectionTest Fix: 195317191 Change-Id: I85ca70494f0b2663d3344f2a7c3e6e9a68a57ca1