Extract a simple wrapper around ArrayMap called "ArrayMapWithHistory",
with associated tests. TimeDetectorStrategyImpl and
TimeZoneDetectorStrategy were duplicating some data structure logic.
ArrayMapWithHistory works the same as ArrayMap, but there is a (mostly
hidden) history of the values for each map entry. This is useful for
debugging.
A second class, ReferenceWithHistory, has been included to support the
ArrayMapWithHistory class and for use when extending the time / time
zone detector strategy implementations: this will be useful as
additional sources like GNSS / NTP are added to time detector, and
geo-location are added to time zone detection.
Bug: 146563025
Bug: 140712361
Test: atest com.android.server.timedetector
Test: atest com.android.server.timezonedetector
Change-Id: Ia6195cb628679a6a32c0118d2921e699514eed7d
The annotation processor is being modified to produce an intermediate
output that will then be processed to produce the config that ends up on
device. As such, using XmlWriter in frameworks test code no longer makes
sense.
Instead, hard-code XML config in the test to break this problematic
dependency.
Test: atest CompatConfigTest
Change-Id: I371ba32bd83d6a84de94d594169dbb5c63f3d9be
Merged-In: I371ba32bd83d6a84de94d594169dbb5c63f3d9be
Fix TimeZoneDetectorStrategyTest#testFirstPlausiblePhoneSuggestionAcceptedWhenTimeZoneUninitialized.
A test that isn't run by treehugger. Broken by commit
9a81291281.
Test: atest com.android.server.timezonedetector
Bug: 140712361
Change-Id: Id1c867caf45055c22d6b8462534624cc82032293
This is a minimal change to allow ApexManager to work with the apex
service API change in aosp/1189340.
Bug: 141148175
Test: atest CtsRollbackManagerHostTestCases
Test: atest CtsStagedInstallHostTestCases
Change-Id: If0065516cfb32ee6c3dcaafeae7b8546a8cae903
Merged-In: I560ee4ed6dd82277892a511909378d5a5a8502ff
Fix TimeDetectorServiceTest permissions test. The suggestManualTime()
call was changed from enforceCallingPermission() to
enforceCallingOrSelfPermission() in commit 44fcf29.
Bug: 140712361
Test: atest com.android.server.timedetector
Change-Id: Ice263c7605c2ef7a04031404a25e2696f16b075c
Rename SimpleTimeZoneDetectorStrategy to TimeZoneDetectorStrategyImpl.
Its defining characteristic is not simplicity - it's currently the
only implementation.
There are also some small cleanups around the
TimeDetectorStrategy.Callback not being needed by TimeDetectorService.
Bug: 140712361
Test: treehugger only
Change-Id: Icdf365a6a123574fb2cd21b89a9749a2f386c5fd
Android has dual sim devices, which means multiple "phone" time
signals. NITZ is generally trusted and considered "good enough" in the
absence of better signals, but it is provided by carriers and it's not
unusual for the signals to be incorrect by minutes. We don't want the
device system clock just flicking to the latest signal received.
The changes to the SimpleTimeDetectorStrategy try to balance recency and
provide some consistency / determinism. See comments in the code for
details. The time zone detection works in a similar way, particularly
with respect to choosing the lowest phoneId in the event of a tie.
There will be a follow-up change to remove the word "Simple" from
SimpleTimeDetectorStrategy as it no longer applies.
Test: atest services/tests/servicestests/src/com/android/server/timedetector/SimpleTimeDetectorStrategyTest.java
Test: atest android.app.timedetector
Bug: 140712361
Change-Id: I228aff8709eabfcec910af22f7ab08fee32d566a
See CL with change id (I0680034ed9315aa2c05282524d48faaed066ebd0) for
the meaningful changes/description. This change was reverted in qt-qpr1-dev
in order to fix a bug but never got unreverted due to the qt-dev CL
having the same change-id as the reverted one.
Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceNotificationListenerTest
Change-Id: I50f16072b0e56ab69aabf8010ffffd172ca7c05a
The extra key for subscription ID of ACTION_CARRIER_CONFIG_CHANGED is
CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX.
Bug: 140908357
Test: make
Change-Id: I437ebf67bd27e2ac69b2b7784d98d7683350652c
Merged-In: I437ebf67bd27e2ac69b2b7784d98d7683350652c
android.intent.action.NETWORK_SET_TIMEZONE is not used by anything in
the platform so it can be removed. It was previously broadcast when
telephony made a time zone change, presumably as a way to coordinate
time zone detection logic if there were other, lower-priority detection
mechanisms on the device. The logic for time zone detection is now
centralized in the system server so coordination can be done more
directly when needed.
All the APK usages appear to be only manifest entries for
<protected-broadcast> in apps that don't send the intent themselves,
which doesn't make a lot of sense.
Note: There is a separate commit to remove the broadcast from the old
(disabled) NITZ logic.
Bug: 140712361
Test: treehugger
Change-Id: Iab629778e45815f4632359e90d920b7751c1a199
Add TimeZoneDetector.suggestManualTimeZone() to set the time zone
"manually" and switch the device policy manager code over to using
it.
Add RequiredPermission annotations to TimeZoneDetector while there.
Bug: 140712361
Test: treehugger only
Test: atest services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Change-Id: Id247fddfdd793732dd88294ee215eda37cd0be4c