Avoid redundant overwrite of value in TimeSparseArray

TimeSparseArray complains when a value for a given time is overwritten
to warn of possible mistakes.
WakingActivityHistory#recordActivity was overwriting the value for a
given time by itself.

Added unit tests to exercise this code path.

Test: atest FrameworksServicesTests:WakingActivityHistoryTest

Bug: 279599693
Change-Id: Icf95b8964981b891a83e461aee620071497b81f2
2 files changed