ConnectivityService: simplify WakeLock management
This patch simplifies wakelock management by acknowledging that only one acquisition at most is in flight at any time. This allows to remove the serial number associated with wakelock acquisition and to avoid double release when regaining a default network. Example of $ adb shell dumpsys connectivity logs: NetTransition WakeLock activity (most recent first): 03-31 00:15:13.816 - RELEASE (EVENT_CLEAR_NET_TRANSITION_WAKELOCK) 03-31 00:14:59.216 - ACQUIRE for NetworkAgentInfo [WIFI () - 101] 03-31 00:09:05.799 - RELEASE (EVENT_EXPIRE_NET_TRANSITION_WAKELOCK) 03-31 00:08:05.738 - ACQUIRE for NetworkAgentInfo [WIFI () - 100] Test: watched wakelock section $ adb shell dumpsys connectivity while turning on and off Wifi (with no other network). Bug: 36703718 Change-Id: I899b0816c0e41b3991d9540e9b9a604914ff673a
Loading
Please register or sign in to comment