From 040dc8e2cdb7516a6487b08ad12b0b4f803e464a Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Tue, 26 Jan 2021 20:18:01 +0000 Subject: [PATCH] Move code from c.a.server.location.timezone Move code from com.android.server.location.timezone to com.android.server.timezonedetector.location. It has more in common with time zone detection than location code. Bug: 175119330 Test: Treehugger Change-Id: I80e8c88ba1e3903f3b662cb195c5b2877ba661b0 --- .../BinderLocationTimeZoneProvider.java | 16 +++++------ .../location}/ControllerCallbackImpl.java | 2 +- .../location}/ControllerEnvironmentImpl.java | 2 +- .../location}/ControllerImpl.java | 28 +++++++++---------- .../location}/HandlerThreadingDomain.java | 2 +- .../LocationTimeZoneManagerService.java | 2 +- .../LocationTimeZoneManagerServiceState.java | 4 +-- .../LocationTimeZoneManagerShellCommand.java | 18 ++++++------ .../location}/LocationTimeZoneProvider.java | 28 +++++++++---------- .../LocationTimeZoneProviderController.java | 4 +-- .../LocationTimeZoneProviderProxy.java | 2 +- .../NullLocationTimeZoneProviderProxy.java | 2 +- .../RealLocationTimeZoneProviderProxy.java | 4 +-- ...imulatedLocationTimeZoneProviderProxy.java | 2 +- .../location}/TestCommand.java | 2 +- .../location}/ThreadingDomain.java | 2 +- .../location}/TimeZoneProviderEvent.java | 2 +- .../location}/TimeZoneProviderRequest.java | 2 +- .../java/com/android/server/SystemServer.java | 2 +- .../location}/ControllerImplTest.java | 26 ++++++++--------- .../location}/HandlerThreadingDomainTest.java | 4 +-- .../LocationTimeZoneProviderTest.java | 18 ++++++------ .../location}/TestSupport.java | 2 +- .../location}/TestThreadingDomain.java | 2 +- 24 files changed, 88 insertions(+), 90 deletions(-) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/BinderLocationTimeZoneProvider.java (89%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/ControllerCallbackImpl.java (96%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/ControllerEnvironmentImpl.java (98%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/ControllerImpl.java (95%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/HandlerThreadingDomain.java (98%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneManagerService.java (99%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneManagerServiceState.java (95%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneManagerShellCommand.java (92%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneProvider.java (95%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneProviderController.java (97%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneProviderProxy.java (99%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/NullLocationTimeZoneProviderProxy.java (98%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/RealLocationTimeZoneProviderProxy.java (98%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/SimulatedLocationTimeZoneProviderProxy.java (99%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/TestCommand.java (99%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/ThreadingDomain.java (99%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/TimeZoneProviderEvent.java (98%) rename services/core/java/com/android/server/{location/timezone => timezonedetector/location}/TimeZoneProviderRequest.java (98%) rename services/tests/servicestests/src/com/android/server/{location/timezone => timezonedetector/location}/ControllerImplTest.java (98%) rename services/tests/servicestests/src/com/android/server/{location/timezone => timezonedetector/location}/HandlerThreadingDomainTest.java (98%) rename services/tests/servicestests/src/com/android/server/{location/timezone => timezonedetector/location}/LocationTimeZoneProviderTest.java (92%) rename services/tests/servicestests/src/com/android/server/{location/timezone => timezonedetector/location}/TestSupport.java (97%) rename services/tests/servicestests/src/com/android/server/{location/timezone => timezonedetector/location}/TestThreadingDomain.java (98%) diff --git a/services/core/java/com/android/server/location/timezone/BinderLocationTimeZoneProvider.java b/services/core/java/com/android/server/timezonedetector/location/BinderLocationTimeZoneProvider.java similarity index 89% rename from services/core/java/com/android/server/location/timezone/BinderLocationTimeZoneProvider.java rename to services/core/java/com/android/server/timezonedetector/location/BinderLocationTimeZoneProvider.java index 210fb5c0a1ab9..c0c9e6d58622c 100644 --- a/services/core/java/com/android/server/location/timezone/BinderLocationTimeZoneProvider.java +++ b/services/core/java/com/android/server/timezonedetector/location/BinderLocationTimeZoneProvider.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; -import static com.android.server.location.timezone.LocationTimeZoneManagerService.debugLog; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; +import static com.android.server.timezonedetector.location.LocationTimeZoneManagerService.debugLog; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; import android.annotation.NonNull; import android.annotation.Nullable; diff --git a/services/core/java/com/android/server/location/timezone/ControllerCallbackImpl.java b/services/core/java/com/android/server/timezonedetector/location/ControllerCallbackImpl.java similarity index 96% rename from services/core/java/com/android/server/location/timezone/ControllerCallbackImpl.java rename to services/core/java/com/android/server/timezonedetector/location/ControllerCallbackImpl.java index cd9aa2fd6a5b7..46eaad075b54c 100644 --- a/services/core/java/com/android/server/location/timezone/ControllerCallbackImpl.java +++ b/services/core/java/com/android/server/timezonedetector/location/ControllerCallbackImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; diff --git a/services/core/java/com/android/server/location/timezone/ControllerEnvironmentImpl.java b/services/core/java/com/android/server/timezonedetector/location/ControllerEnvironmentImpl.java similarity index 98% rename from services/core/java/com/android/server/location/timezone/ControllerEnvironmentImpl.java rename to services/core/java/com/android/server/timezonedetector/location/ControllerEnvironmentImpl.java index d896f6e441d8b..83b33ee75de98 100644 --- a/services/core/java/com/android/server/location/timezone/ControllerEnvironmentImpl.java +++ b/services/core/java/com/android/server/timezonedetector/location/ControllerEnvironmentImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; diff --git a/services/core/java/com/android/server/location/timezone/ControllerImpl.java b/services/core/java/com/android/server/timezonedetector/location/ControllerImpl.java similarity index 95% rename from services/core/java/com/android/server/location/timezone/ControllerImpl.java rename to services/core/java/com/android/server/timezonedetector/location/ControllerImpl.java index 0d284fc2de4fe..fb2a18493b7d5 100644 --- a/services/core/java/com/android/server/location/timezone/ControllerImpl.java +++ b/services/core/java/com/android/server/timezonedetector/location/ControllerImpl.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; -import static com.android.server.location.timezone.LocationTimeZoneManagerService.debugLog; -import static com.android.server.location.timezone.LocationTimeZoneManagerService.warnLog; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; -import static com.android.server.location.timezone.TimeZoneProviderEvent.EVENT_TYPE_PERMANENT_FAILURE; -import static com.android.server.location.timezone.TimeZoneProviderEvent.EVENT_TYPE_SUGGESTION; -import static com.android.server.location.timezone.TimeZoneProviderEvent.EVENT_TYPE_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneManagerService.debugLog; +import static com.android.server.timezonedetector.location.LocationTimeZoneManagerService.warnLog; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; +import static com.android.server.timezonedetector.location.TimeZoneProviderEvent.EVENT_TYPE_PERMANENT_FAILURE; +import static com.android.server.timezonedetector.location.TimeZoneProviderEvent.EVENT_TYPE_SUGGESTION; +import static com.android.server.timezonedetector.location.TimeZoneProviderEvent.EVENT_TYPE_UNCERTAIN; import android.annotation.DurationMillisLong; import android.annotation.NonNull; @@ -36,9 +36,9 @@ import android.os.RemoteCallback; import android.util.IndentingPrintWriter; import com.android.internal.annotations.GuardedBy; -import com.android.server.location.timezone.ThreadingDomain.SingleRunnableQueue; import com.android.server.timezonedetector.ConfigurationInternal; import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion; +import com.android.server.timezonedetector.location.ThreadingDomain.SingleRunnableQueue; import java.time.Duration; import java.util.List; diff --git a/services/core/java/com/android/server/location/timezone/HandlerThreadingDomain.java b/services/core/java/com/android/server/timezonedetector/location/HandlerThreadingDomain.java similarity index 98% rename from services/core/java/com/android/server/location/timezone/HandlerThreadingDomain.java rename to services/core/java/com/android/server/timezonedetector/location/HandlerThreadingDomain.java index 3055ff8a2b596..0dd2922bb2406 100644 --- a/services/core/java/com/android/server/location/timezone/HandlerThreadingDomain.java +++ b/services/core/java/com/android/server/timezonedetector/location/HandlerThreadingDomain.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.DurationMillisLong; import android.annotation.NonNull; diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerService.java similarity index 99% rename from services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java rename to services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerService.java index 54535eb501308..5bee7ee9d4b24 100644 --- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java +++ b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static android.app.time.LocationTimeZoneManager.PRIMARY_PROVIDER_NAME; import static android.app.time.LocationTimeZoneManager.PROVIDER_MODE_OVERRIDE_DISABLED; diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerServiceState.java b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerServiceState.java similarity index 95% rename from services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerServiceState.java rename to services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerServiceState.java index b1dd55f3d4fdc..113926a265f5d 100644 --- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerServiceState.java +++ b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerServiceState.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; import android.annotation.Nullable; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState; import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState; import java.util.ArrayList; import java.util.Collections; diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerShellCommand.java b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerShellCommand.java similarity index 92% rename from services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerShellCommand.java rename to services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerShellCommand.java index 6f9863c9bd096..b53150c729bc3 100644 --- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerShellCommand.java +++ b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneManagerShellCommand.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static android.app.time.LocationTimeZoneManager.DUMP_STATE_OPTION_PROTO; import static android.app.time.LocationTimeZoneManager.PRIMARY_PROVIDER_NAME; @@ -28,13 +28,13 @@ import static android.app.time.LocationTimeZoneManager.SHELL_COMMAND_SET_PROVIDE import static android.app.time.LocationTimeZoneManager.SHELL_COMMAND_START; import static android.app.time.LocationTimeZoneManager.SHELL_COMMAND_STOP; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_UNKNOWN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_UNKNOWN; import android.annotation.NonNull; import android.app.time.GeolocationTimeZoneSuggestionProto; @@ -47,8 +47,8 @@ import android.util.IndentingPrintWriter; import android.util.proto.ProtoOutputStream; import com.android.internal.util.dump.DualDumpOutputStream; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.ProviderStateEnum; import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.ProviderStateEnum; import java.io.FileDescriptor; import java.io.PrintWriter; diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneProvider.java b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProvider.java similarity index 95% rename from services/core/java/com/android/server/location/timezone/LocationTimeZoneProvider.java rename to services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProvider.java index 9a7b7750659c6..ef2f357b8c3ef 100644 --- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneProvider.java +++ b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProvider.java @@ -14,22 +14,22 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static android.service.timezone.TimeZoneProviderService.TEST_COMMAND_RESULT_ERROR_KEY; import static android.service.timezone.TimeZoneProviderService.TEST_COMMAND_RESULT_SUCCESS_KEY; -import static com.android.server.location.timezone.LocationTimeZoneManagerService.debugLog; -import static com.android.server.location.timezone.LocationTimeZoneManagerService.warnLog; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; -import static com.android.server.location.timezone.TimeZoneProviderEvent.EVENT_TYPE_PERMANENT_FAILURE; -import static com.android.server.location.timezone.TimeZoneProviderEvent.EVENT_TYPE_SUGGESTION; -import static com.android.server.location.timezone.TimeZoneProviderEvent.EVENT_TYPE_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneManagerService.debugLog; +import static com.android.server.timezonedetector.location.LocationTimeZoneManagerService.warnLog; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; +import static com.android.server.timezonedetector.location.TimeZoneProviderEvent.EVENT_TYPE_PERMANENT_FAILURE; +import static com.android.server.timezonedetector.location.TimeZoneProviderEvent.EVENT_TYPE_SUGGESTION; +import static com.android.server.timezonedetector.location.TimeZoneProviderEvent.EVENT_TYPE_UNCERTAIN; import android.annotation.ElapsedRealtimeLong; import android.annotation.IntDef; @@ -42,11 +42,11 @@ import android.os.SystemClock; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.ProviderStateEnum; -import com.android.server.location.timezone.ThreadingDomain.SingleRunnableQueue; import com.android.server.timezonedetector.ConfigurationInternal; import com.android.server.timezonedetector.Dumpable; import com.android.server.timezonedetector.ReferenceWithHistory; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.ProviderStateEnum; +import com.android.server.timezonedetector.location.ThreadingDomain.SingleRunnableQueue; import java.time.Duration; import java.util.ArrayList; diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderController.java b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProviderController.java similarity index 97% rename from services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderController.java rename to services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProviderController.java index ec2bc13b8a16e..b4aff3e005ad0 100644 --- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderController.java +++ b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProviderController.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.DurationMillisLong; import android.annotation.NonNull; import android.os.Handler; import com.android.internal.annotations.VisibleForTesting; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState; import com.android.server.timezonedetector.ConfigurationInternal; import com.android.server.timezonedetector.Dumpable; import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState; import java.time.Duration; import java.util.Objects; diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderProxy.java b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProviderProxy.java similarity index 99% rename from services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderProxy.java rename to services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProviderProxy.java index 8368b5ed5d75a..43b1b5f017b21 100644 --- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderProxy.java +++ b/services/core/java/com/android/server/timezonedetector/location/LocationTimeZoneProviderProxy.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; import android.annotation.Nullable; diff --git a/services/core/java/com/android/server/location/timezone/NullLocationTimeZoneProviderProxy.java b/services/core/java/com/android/server/timezonedetector/location/NullLocationTimeZoneProviderProxy.java similarity index 98% rename from services/core/java/com/android/server/location/timezone/NullLocationTimeZoneProviderProxy.java rename to services/core/java/com/android/server/timezonedetector/location/NullLocationTimeZoneProviderProxy.java index c2abbf9a1b8c7..1f45e828aad4c 100644 --- a/services/core/java/com/android/server/location/timezone/NullLocationTimeZoneProviderProxy.java +++ b/services/core/java/com/android/server/timezonedetector/location/NullLocationTimeZoneProviderProxy.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; import android.annotation.Nullable; diff --git a/services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java b/services/core/java/com/android/server/timezonedetector/location/RealLocationTimeZoneProviderProxy.java similarity index 98% rename from services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java rename to services/core/java/com/android/server/timezonedetector/location/RealLocationTimeZoneProviderProxy.java index 0904ba419b3d6..38211efc1c63d 100644 --- a/services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java +++ b/services/core/java/com/android/server/timezonedetector/location/RealLocationTimeZoneProviderProxy.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.service.timezone.TimeZoneProviderService.TEST_COMMAND_RESULT_ERROR_KEY; import static android.service.timezone.TimeZoneProviderService.TEST_COMMAND_RESULT_SUCCESS_KEY; -import static com.android.server.location.timezone.LocationTimeZoneManagerService.warnLog; +import static com.android.server.timezonedetector.location.LocationTimeZoneManagerService.warnLog; import android.Manifest; import android.annotation.NonNull; diff --git a/services/core/java/com/android/server/location/timezone/SimulatedLocationTimeZoneProviderProxy.java b/services/core/java/com/android/server/timezonedetector/location/SimulatedLocationTimeZoneProviderProxy.java similarity index 99% rename from services/core/java/com/android/server/location/timezone/SimulatedLocationTimeZoneProviderProxy.java rename to services/core/java/com/android/server/timezonedetector/location/SimulatedLocationTimeZoneProviderProxy.java index 66ccaed25e329..02b0a849c1b13 100644 --- a/services/core/java/com/android/server/location/timezone/SimulatedLocationTimeZoneProviderProxy.java +++ b/services/core/java/com/android/server/timezonedetector/location/SimulatedLocationTimeZoneProviderProxy.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static android.app.time.LocationTimeZoneManager.SIMULATED_PROVIDER_TEST_COMMAND_ON_BIND; import static android.app.time.LocationTimeZoneManager.SIMULATED_PROVIDER_TEST_COMMAND_ON_UNBIND; diff --git a/services/core/java/com/android/server/location/timezone/TestCommand.java b/services/core/java/com/android/server/timezonedetector/location/TestCommand.java similarity index 99% rename from services/core/java/com/android/server/location/timezone/TestCommand.java rename to services/core/java/com/android/server/timezonedetector/location/TestCommand.java index 0df3ca087fc70..21482ea6ff79f 100644 --- a/services/core/java/com/android/server/location/timezone/TestCommand.java +++ b/services/core/java/com/android/server/timezonedetector/location/TestCommand.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; import android.net.Uri; diff --git a/services/core/java/com/android/server/location/timezone/ThreadingDomain.java b/services/core/java/com/android/server/timezonedetector/location/ThreadingDomain.java similarity index 99% rename from services/core/java/com/android/server/location/timezone/ThreadingDomain.java rename to services/core/java/com/android/server/timezonedetector/location/ThreadingDomain.java index 4ada6f50b40e3..9e3497f92dc0f 100644 --- a/services/core/java/com/android/server/location/timezone/ThreadingDomain.java +++ b/services/core/java/com/android/server/timezonedetector/location/ThreadingDomain.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.DurationMillisLong; import android.annotation.NonNull; diff --git a/services/core/java/com/android/server/location/timezone/TimeZoneProviderEvent.java b/services/core/java/com/android/server/timezonedetector/location/TimeZoneProviderEvent.java similarity index 98% rename from services/core/java/com/android/server/location/timezone/TimeZoneProviderEvent.java rename to services/core/java/com/android/server/timezonedetector/location/TimeZoneProviderEvent.java index 2d6f8ad446f0b..3e224e03fda01 100644 --- a/services/core/java/com/android/server/location/timezone/TimeZoneProviderEvent.java +++ b/services/core/java/com/android/server/timezonedetector/location/TimeZoneProviderEvent.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.IntDef; import android.annotation.NonNull; diff --git a/services/core/java/com/android/server/location/timezone/TimeZoneProviderRequest.java b/services/core/java/com/android/server/timezonedetector/location/TimeZoneProviderRequest.java similarity index 98% rename from services/core/java/com/android/server/location/timezone/TimeZoneProviderRequest.java rename to services/core/java/com/android/server/timezonedetector/location/TimeZoneProviderRequest.java index 649a74bbed49d..14820319d9dfd 100644 --- a/services/core/java/com/android/server/location/timezone/TimeZoneProviderRequest.java +++ b/services/core/java/com/android/server/timezonedetector/location/TimeZoneProviderRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.NonNull; import android.annotation.Nullable; diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 12595af1db7ff..0768bb93839df 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -326,7 +326,7 @@ public final class SystemServer implements Dumpable { private static final String TIME_ZONE_DETECTOR_SERVICE_CLASS = "com.android.server.timezonedetector.TimeZoneDetectorService$Lifecycle"; private static final String LOCATION_TIME_ZONE_MANAGER_SERVICE_CLASS = - "com.android.server.location.timezone.LocationTimeZoneManagerService$Lifecycle"; + "com.android.server.timezonedetector.location.LocationTimeZoneManagerService$Lifecycle"; private static final String GNSS_TIME_UPDATE_SERVICE_CLASS = "com.android.server.timedetector.GnssTimeUpdateService$Lifecycle"; private static final String ACCESSIBILITY_MANAGER_SERVICE_CLASS = diff --git a/services/tests/servicestests/src/com/android/server/location/timezone/ControllerImplTest.java b/services/tests/servicestests/src/com/android/server/timezonedetector/location/ControllerImplTest.java similarity index 98% rename from services/tests/servicestests/src/com/android/server/location/timezone/ControllerImplTest.java rename to services/tests/servicestests/src/com/android/server/timezonedetector/location/ControllerImplTest.java index 972b3bb8b4593..4284240c72b40 100644 --- a/services/tests/servicestests/src/com/android/server/location/timezone/ControllerImplTest.java +++ b/services/tests/servicestests/src/com/android/server/timezonedetector/location/ControllerImplTest.java @@ -13,18 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; -import static com.android.server.location.timezone.TestSupport.USER1_CONFIG_GEO_DETECTION_DISABLED; -import static com.android.server.location.timezone.TestSupport.USER1_CONFIG_GEO_DETECTION_ENABLED; -import static com.android.server.location.timezone.TestSupport.USER2_CONFIG_GEO_DETECTION_ENABLED; -import static com.android.server.location.timezone.TimeZoneProviderEvent.createPermanentFailureEvent; -import static com.android.server.location.timezone.TimeZoneProviderEvent.createUncertainEvent; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; +import static com.android.server.timezonedetector.location.TestSupport.USER1_CONFIG_GEO_DETECTION_DISABLED; +import static com.android.server.timezonedetector.location.TestSupport.USER1_CONFIG_GEO_DETECTION_ENABLED; +import static com.android.server.timezonedetector.location.TestSupport.USER2_CONFIG_GEO_DETECTION_ENABLED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -40,10 +38,10 @@ import android.platform.test.annotations.Presubmit; import android.service.timezone.TimeZoneProviderSuggestion; import android.util.IndentingPrintWriter; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.ProviderStateEnum; import com.android.server.timezonedetector.ConfigurationInternal; import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion; import com.android.server.timezonedetector.TestState; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.ProviderStateEnum; import org.junit.Before; import org.junit.Test; @@ -66,9 +64,9 @@ public class ControllerImplTest { private static final TimeZoneProviderEvent USER1_SUCCESS_LOCATION_TIME_ZONE_EVENT2 = createSuggestionEvent(asList("Europe/Paris")); private static final TimeZoneProviderEvent USER1_UNCERTAIN_LOCATION_TIME_ZONE_EVENT = - createUncertainEvent(); + TimeZoneProviderEvent.createUncertainEvent(); private static final TimeZoneProviderEvent USER1_PERM_FAILURE_LOCATION_TIME_ZONE_EVENT = - createPermanentFailureEvent("Test"); + TimeZoneProviderEvent.createPermanentFailureEvent("Test"); private TestThreadingDomain mTestThreadingDomain; private TestCallback mTestCallback; diff --git a/services/tests/servicestests/src/com/android/server/location/timezone/HandlerThreadingDomainTest.java b/services/tests/servicestests/src/com/android/server/timezonedetector/location/HandlerThreadingDomainTest.java similarity index 98% rename from services/tests/servicestests/src/com/android/server/location/timezone/HandlerThreadingDomainTest.java rename to services/tests/servicestests/src/com/android/server/timezonedetector/location/HandlerThreadingDomainTest.java index 02de24de435e7..e7dd97949bb06 100644 --- a/services/tests/servicestests/src/com/android/server/location/timezone/HandlerThreadingDomainTest.java +++ b/services/tests/servicestests/src/com/android/server/timezonedetector/location/HandlerThreadingDomainTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertSame; @@ -24,7 +24,7 @@ import android.os.Handler; import android.os.HandlerThread; import android.platform.test.annotations.Presubmit; -import com.android.server.location.timezone.ThreadingDomain.SingleRunnableQueue; +import com.android.server.timezonedetector.location.ThreadingDomain.SingleRunnableQueue; import org.junit.After; import org.junit.Before; diff --git a/services/tests/servicestests/src/com/android/server/location/timezone/LocationTimeZoneProviderTest.java b/services/tests/servicestests/src/com/android/server/timezonedetector/location/LocationTimeZoneProviderTest.java similarity index 92% rename from services/tests/servicestests/src/com/android/server/location/timezone/LocationTimeZoneProviderTest.java rename to services/tests/servicestests/src/com/android/server/timezonedetector/location/LocationTimeZoneProviderTest.java index cb292db501150..095c868fc74cd 100644 --- a/services/tests/servicestests/src/com/android/server/location/timezone/LocationTimeZoneProviderTest.java +++ b/services/tests/servicestests/src/com/android/server/timezonedetector/location/LocationTimeZoneProviderTest.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static android.service.timezone.TimeZoneProviderService.TEST_COMMAND_RESULT_ERROR_KEY; import static android.service.timezone.TimeZoneProviderService.TEST_COMMAND_RESULT_SUCCESS_KEY; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; -import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; -import static com.android.server.location.timezone.TestSupport.USER1_CONFIG_GEO_DETECTION_ENABLED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DESTROYED; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_UNCERTAIN; +import static com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STOPPED; +import static com.android.server.timezonedetector.location.TestSupport.USER1_CONFIG_GEO_DETECTION_ENABLED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -40,10 +40,10 @@ import android.platform.test.annotations.Presubmit; import android.service.timezone.TimeZoneProviderSuggestion; import android.util.IndentingPrintWriter; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderListener; -import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState; import com.android.server.timezonedetector.ConfigurationInternal; import com.android.server.timezonedetector.TestState; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderListener; +import com.android.server.timezonedetector.location.LocationTimeZoneProvider.ProviderState; import org.junit.Before; import org.junit.Test; diff --git a/services/tests/servicestests/src/com/android/server/location/timezone/TestSupport.java b/services/tests/servicestests/src/com/android/server/timezonedetector/location/TestSupport.java similarity index 97% rename from services/tests/servicestests/src/com/android/server/location/timezone/TestSupport.java rename to services/tests/servicestests/src/com/android/server/timezonedetector/location/TestSupport.java index 48105634c69df..d319488ba73b9 100644 --- a/services/tests/servicestests/src/com/android/server/location/timezone/TestSupport.java +++ b/services/tests/servicestests/src/com/android/server/timezonedetector/location/TestSupport.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import android.annotation.UserIdInt; diff --git a/services/tests/servicestests/src/com/android/server/location/timezone/TestThreadingDomain.java b/services/tests/servicestests/src/com/android/server/timezonedetector/location/TestThreadingDomain.java similarity index 98% rename from services/tests/servicestests/src/com/android/server/location/timezone/TestThreadingDomain.java rename to services/tests/servicestests/src/com/android/server/timezonedetector/location/TestThreadingDomain.java index b1a5ff9b549cd..e08fea083d81d 100644 --- a/services/tests/servicestests/src/com/android/server/location/timezone/TestThreadingDomain.java +++ b/services/tests/servicestests/src/com/android/server/timezonedetector/location/TestThreadingDomain.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.server.location.timezone; +package com.android.server.timezonedetector.location; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse;