Refactoring: Support alt. network time source
Refactoring to support an alternative source of network time for passing to the GNSS component. The new implementation will be submitted in a follow-up. NtpTimeHelper has been replaced by NetworkTimeHelper in GnssLocationProvider. NetworkTimeHelper provides the stable interface between GnssLocationProvider and the original / alternative impl for what was NtpTimeHelper. NtpTimeHelper has been renamed NtpNetworkTimeHelper. These changes are not intended to change any behavior. There are some minor changes between the interaction between GnssLocationProvider and the NetworkTimeHelper class, but these are not expected to alter the runtime behavior. The NetworkTimeHelper.setPeriodicTimeInjectionMode() method touches a pre-existing bug: The method name reflected the effect of the method, which is the near-opposite of what the capability name would suggest. This appears to be due to an accidental logic inversion, not by intent. As can be seen in the changes for GnssLocationProvider: the enablePeriodicTimeInjection() method was called when mGnssNative.getCapabilities().hasOnDemandTime() was true. The existence of bug 73893222 supports the fact that there is a long-standing bug here. The intent with this commit is not to fix it or alter behavior, just to make it more obvious, as it is unclear if the current behavior is relied upon somewhere. Comments and field names have been improved to try to clarify the actual behavior. Bug: 73893222 Bug: 222295093 Test: atest services/robotests/src/com/android/server/location/gnss/NtpNetworkTimeHelperTest.java Change-Id: I0b1ba43a55ff531df343c022650e3f5721dda7f1
Loading
Please register or sign in to comment