diff --git a/services/core/java/com/android/server/timezonedetector/Dumpable.java b/services/core/java/com/android/server/timezonedetector/Dumpable.java index 5603c38bd0aee..1dd963795f6d0 100644 --- a/services/core/java/com/android/server/timezonedetector/Dumpable.java +++ b/services/core/java/com/android/server/timezonedetector/Dumpable.java @@ -24,18 +24,4 @@ public interface Dumpable { /** Dump internal state. */ void dump(@NonNull IndentingPrintWriter pw, @Nullable String[] args); - - /** - * An interface that can be used expose when one component allows another to be registered so - * that it is dumped at the same time. - */ - interface Container { - - /** - * Registers the supplied {@link Dumpable}. When the implementation is dumped - * {@link Dumpable#dump(IndentingPrintWriter, String[])} should be called on the - * {@code dumpable}. - */ - void addDumpable(@NonNull Dumpable dumpable); - } } diff --git a/services/core/java/com/android/server/timezonedetector/EnvironmentImpl.java b/services/core/java/com/android/server/timezonedetector/EnvironmentImpl.java index b84f8a850ba76..fc6e372b80414 100644 --- a/services/core/java/com/android/server/timezonedetector/EnvironmentImpl.java +++ b/services/core/java/com/android/server/timezonedetector/EnvironmentImpl.java @@ -72,8 +72,8 @@ final class EnvironmentImpl implements TimeZoneDetectorStrategyImpl.Environment mLocationManager = context.getSystemService(LocationManager.class); mServiceConfigAccessor = Objects.requireNonNull(serviceConfigAccessor); - // Wire up the config change listeners. All invocations are performed on the mHandler - // thread. + // Wire up the config change listeners for anything that could affect the return values from + // this object. All listener invocations are performed on the mHandler thread. // Listen for the user changing / the user's location mode changing. IntentFilter filter = new IntentFilter(); @@ -88,25 +88,19 @@ final class EnvironmentImpl implements TimeZoneDetectorStrategyImpl.Environment // Add async callbacks for global settings being changed. ContentResolver contentResolver = mContext.getContentResolver(); + ContentObserver contentObserver = new ContentObserver(mHandler) { + @Override + public void onChange(boolean selfChange) { + handleConfigChangeOnHandlerThread(); + } + }; contentResolver.registerContentObserver( - Settings.Global.getUriFor(Settings.Global.AUTO_TIME_ZONE), true, - new ContentObserver(mHandler) { - @Override - public void onChange(boolean selfChange) { - handleConfigChangeOnHandlerThread(); - } - }); + Settings.Global.getUriFor(Settings.Global.AUTO_TIME_ZONE), true, contentObserver); // Add async callbacks for user scoped location settings being changed. contentResolver.registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.LOCATION_TIME_ZONE_DETECTION_ENABLED), - true, - new ContentObserver(mHandler) { - @Override - public void onChange(boolean selfChange) { - handleConfigChangeOnHandlerThread(); - } - }, UserHandle.USER_ALL); + true, contentObserver, UserHandle.USER_ALL); } private void handleConfigChangeOnHandlerThread() { diff --git a/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java b/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java index 3b3254985abca..f4a6ef0bf25c0 100644 --- a/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java +++ b/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java @@ -39,12 +39,11 @@ import java.util.StringTokenizer; *