OSDN Git Service

Fix keepalive don't get removed when lower layer error
authorjunyulai <junyulai@google.com>
Wed, 27 Mar 2019 02:31:11 +0000 (10:31 +0800)
committerjunyulai <junyulai@google.com>
Wed, 27 Mar 2019 03:38:58 +0000 (11:38 +0800)
commit422a3c14486f7beeb2297df07ad59159819a33be
tree374a4aa9e69491c316ba709281984ee44317a2b0
parent06bdf061f00cf6017976e8b26da007729c800e10
Fix keepalive don't get removed when lower layer error

Currently, if the lower layer, e.g. wifi, didn't successfully
start keepalive by any reason. Due to the startedState changed
to NOT_STARTED first, the logic inside stop() will skip the
removing process and cause leak.

Thus, moving the changing of startedState to proper place first
to unblock subsequent changes first.

Bug: 123988249
Bug: 129371366
Test: atest FrameworksNetTests
Change-Id: I4bba01bacc80e1dac2023ef831b5ade5501894e4
services/core/java/com/android/server/connectivity/KeepaliveTracker.java