[NS A20] Cleanup
A lot of this code can't be triggered at all.
• newNetwork.created in l.6488 is implied by newNetwork.everConnected
in l.6357
• !newNetwork.isVPN() in l.6488 is implied by the fact that VPNs are
always foreground, so oldPermission can't != newPermission in l.6488
• updateUids in l.6502 is useless because uids can't change during a
rematch (because there is no code doing that). Metered state and
roaming state similarly can't change during a rematch, so
meteredChanged and roamingChanged are always false
• updateAllVpnCapabilities in l.6537 is useless because VPN do not
inherit the foreground state of their underlying networks, which
would be the only reason to call that in l.6537
• Object.equals() in l.6480 is necessary false because at this line
it is known that the foreground state has changed, which must have
caused the NET_CAPABILITY_FOREGROUND to be different, so the objects
can't be equal
Test: FrameworksNetTests NetworkStackTest
Change-Id: I2a52f7f4a085f3eea22a1dd170af8f04671250ff
1 file changed