Clone and pass worksource to the Notifier

This addresses the edge case scenario where multiple subsequent updates to the
worksource of a wakelock can change the ordering of the values processed
by the Notifier thread to update the BatteryStatsService. This could
ultimately lead to cases where BatteryStatsService receives the wakelock
stop notifications for uids whose start was never recorded.

Bug: 354303438
Test: Manual
Test: atest NotifierTest
Flag: EXEMPT Bugfix
Change-Id: I95b9fecdc67fc808d46c696edf958b9dbe9b49ef
2 files changed