summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Neil Fuller <nfuller@google.com> 2022-11-15 17:05:24 +0000
committer Neil Fuller <nfuller@google.com> 2022-11-16 12:02:10 +0000
commitb2837a161584a1665b6e6c010996baec4116bc58 (patch)
tree79af9a05415f8848ac26225fd1dce93ca4b04a0b /libs/androidfw/StringPool.cpp
parenta4aee0d52031a243707b2a9015994a0abf7acfeb (diff)
Enable providers to report they are "missing"
Previously, providers were only expected to report suggestions, not status / events. This meant that "missing" providers could pretend to be "real" until they were asked for a suggestion at which point they would "fail". However, now the LocationTimeZoneProviderController tracks provider status. It's useful (and clearer) to know if providers are present even if they haven't been asked to do something yet. In order to determine the difference between a provider that hasn't been started yet and a provider that is missing, this commit modifies LocationTimeZoneProvider's initialize() methods to return a boolean that can indicating initalization has failed. It could already throw a RuntimeException for the same result, but returning a boolean is a explicit interface, leaving the RuntimeException path still to handle coding errors and other exceptional failures. There is a new "DisabledLocationTimeZoneProvider" to cover the "there is no provider" case at the LocationTimeZoneProvider level which is hardcoded to return false from initialize. This change means that the NullLocationTimeZoneProviderProxy, which previously handled the "there is no provider" case at a deeper level, can be deleted. Bug: 236624675 Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/ Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/location/ Change-Id: I7841f91e7ced4b59be27592e2e7c0e3d9c3acf7a
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions