Merge "Add synchronized block when accessing global variables" into main
This commit is contained in:
@@ -517,11 +517,12 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MSG_NOTIFY_NETWORK_STATUS: {
|
case MSG_NOTIFY_NETWORK_STATUS: {
|
||||||
|
synchronized (mStatsLock) {
|
||||||
// If no cached states, ignore.
|
// If no cached states, ignore.
|
||||||
if (mLastNetworkStateSnapshots == null) break;
|
if (mLastNetworkStateSnapshots == null) break;
|
||||||
// TODO (b/181642673): Protect mDefaultNetworks from concurrent accessing.
|
|
||||||
handleNotifyNetworkStatus(
|
handleNotifyNetworkStatus(
|
||||||
mDefaultNetworks, mLastNetworkStateSnapshots, mActiveIface);
|
mDefaultNetworks, mLastNetworkStateSnapshots, mActiveIface);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MSG_PERFORM_POLL_REGISTER_ALERT: {
|
case MSG_PERFORM_POLL_REGISTER_ALERT: {
|
||||||
|
|||||||
Reference in New Issue
Block a user