Ignore older UID state change callbacks in NPMS.
Since the onUidStateChanged() callbacks will be happening from more than one thread, we need to make sure we only handle the latest uid state change callbacks and ignore any older callbacks that could override the latest uid states in NPMS. In order to this, every uid state change will be associated with a unique seq number. Also, remove the UidRecord.lastDispatchedProcStateSeq. This was added as a safety measure to make sure we don't unnecessarily end up waiting but it isn't necessary and if we need to keep it, we need to add a way to access it without holding global AMS lock, which isn't worth the complexity. Bug: 226299593 Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: I631f5e01f6627916a96c930c22849a1d11eab636
Loading
Please register or sign in to comment