Adding selective filtering to LTZP events
This commit introduces a time threshold for passing on "equivalent" events for location time zone providers. When TimeZoneProviderEvent instances are created, they are assigned a time from the elapsed realtime clock, which will enable comparison with other types of events generated by other flows. Events that have a sufficiently different time will be passed to the system server. The time will be in the order of a few minutes, the intention being to filter out high frequency events that would cause the system server to do work unnecessarily, while keeping a coarse idea of how recently the LTZP reported the state. This commit adds the time to the TimeZoneProviderEvent and plumbs through the configuration for the filter threshold from the system server to the client code. The threshold can be set with server flags, which are mostly intended to support the test logic. Changes made at the same time: 1) Fix an issue in TimeZoneProviderRequest.equals() with an incorrect reference equality check. 2) Rename some long-winded constant names - LOCATION_TIME_ZONE_PROVIDER_ -> LTZP_ 3) Change some server flag strings so that "ltzp_" is spelt correctly (which I do not anticipate using, but does mean that S and >S devices respond to different flag strings). Bug: 197624972 Bug: 200710190 Test: atest core/tests/coretests/src/android/service/timezone/ Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/location/ Test: See associated cts/ change Change-Id: Id682d420be21b9215b92f54bad599517c322fb6a
Loading
Please register or sign in to comment