Move LocationTimeZoneEvent to com.android

LocationTimeZoneEvent was originally supposed to fulfil the same role as
Location does in the LocationProvider. Since Location is public SDK, it
was in android.location. LocationTimeZoneEvent is not public SDK (or any
form of API), so it can be moved to com.android instead.
LocationTimeZoneEventUnbundled is in the API in its place.

Bug: 169304499
Test: treehugger only
Change-Id: I5d382362383000b16852928895a18ac4e4269a8f
This commit is contained in:
Neil Fuller
2020-11-24 13:54:14 +00:00
parent 86c9b84b62
commit bd14141056
16 changed files with 33 additions and 35 deletions

View File

@@ -16,7 +16,7 @@
package com.android.internal.location.timezone;
import android.location.timezone.LocationTimeZoneEvent;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
/**
* Binder interface for the manager of location time zone provider implementations.

View File

@@ -14,6 +14,6 @@
* limitations under the License.
*/
package android.location.timezone;
package com.android.internal.location.timezone;
parcelable LocationTimeZoneEvent;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.location.timezone;
package com.android.internal.location.timezone;
import android.annotation.IntDef;
import android.annotation.NonNull;

View File

@@ -18,9 +18,10 @@ package com.android.location.timezone.provider;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.location.timezone.LocationTimeZoneEvent;
import android.os.SystemClock;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

View File

@@ -25,10 +25,10 @@ import static com.android.server.location.timezone.LocationTimeZoneProvider.Prov
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.location.timezone.LocationTimeZoneEvent;
import android.util.IndentingPrintWriter;
import android.util.Slog;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import com.android.internal.location.timezone.LocationTimeZoneProviderRequest;
import java.time.Duration;

View File

@@ -16,10 +16,9 @@
package com.android.server.location.timezone;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
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;
@@ -31,10 +30,10 @@ import static com.android.server.location.timezone.LocationTimeZoneProvider.Prov
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.location.timezone.LocationTimeZoneEvent;
import android.util.IndentingPrintWriter;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import com.android.server.location.timezone.ThreadingDomain.SingleRunnableQueue;
import com.android.server.timezonedetector.ConfigurationInternal;
import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion;

View File

@@ -42,7 +42,7 @@ import java.util.Objects;
* A service class that acts as a container for the {@link LocationTimeZoneProviderController},
* which determines what {@link com.android.server.timezonedetector.GeolocationTimeZoneSuggestion}
* are made to the {@link TimeZoneDetectorInternal}, and the {@link LocationTimeZoneProvider}s that
* offer {@link android.location.timezone.LocationTimeZoneEvent}s.
* (indirectly) generate {@link com.android.internal.location.timezone.LocationTimeZoneEvent}s.
*
* <p>For details of the time zone suggestion behavior, see {@link
* LocationTimeZoneProviderController}.

View File

@@ -16,10 +16,9 @@
package com.android.server.location.timezone;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.server.location.timezone.LocationTimeZoneManagerService.debugLog;
import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DISABLED;
import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_ENABLED_CERTAIN;
@@ -30,12 +29,12 @@ import static com.android.server.location.timezone.LocationTimeZoneProvider.Prov
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.location.timezone.LocationTimeZoneEvent;
import android.os.Handler;
import android.os.SystemClock;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.ProviderStateEnum;
import com.android.server.location.timezone.ThreadingDomain.SingleRunnableQueue;
import com.android.server.timezonedetector.ConfigurationInternal;

View File

@@ -19,11 +19,11 @@ package com.android.server.location.timezone;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.location.timezone.LocationTimeZoneEvent;
import android.os.Handler;
import android.util.IndentingPrintWriter;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import com.android.internal.location.timezone.LocationTimeZoneProviderRequest;
import com.android.server.timezonedetector.Dumpable;

View File

@@ -38,8 +38,8 @@ import java.time.Duration;
* enters a {@link ProviderState#PROVIDER_STATE_PERM_FAILED} state immediately after being enabled
* for the first time and sends the appropriate event, which ensures the {@link
* LocationTimeZoneProviderController} won't expect any further {@link
* android.location.timezone.LocationTimeZoneEvent}s to come from it, and won't attempt to use it
* again.
* com.android.internal.location.timezone.LocationTimeZoneEvent}s to come from it, and won't attempt
* to use it again.
*/
class NullLocationTimeZoneProvider extends LocationTimeZoneProvider {

View File

@@ -20,7 +20,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.Context;
import android.location.timezone.LocationTimeZoneEvent;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.IndentingPrintWriter;
@@ -28,6 +27,7 @@ import android.util.IndentingPrintWriter;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.location.timezone.ILocationTimeZoneProvider;
import com.android.internal.location.timezone.ILocationTimeZoneProviderManager;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import com.android.internal.location.timezone.LocationTimeZoneProviderRequest;
import com.android.server.ServiceWatcher;

View File

@@ -16,19 +16,19 @@
package com.android.server.location.timezone;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.server.location.timezone.LocationTimeZoneManagerService.PRIMARY_PROVIDER_NAME;
import static com.android.server.location.timezone.LocationTimeZoneManagerService.SECONDARY_PROVIDER_NAME;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.location.timezone.LocationTimeZoneEvent;
import android.os.ShellCommand;
import android.os.SystemClock;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package android.location.timezone;
package com.android.internal.location.timezone;
import static android.location.timezone.ParcelableTestSupport.assertRoundTripParcelable;
import static com.android.internal.location.timezone.ParcelableTestSupport.assertRoundTripParcelable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

View File

@@ -16,7 +16,7 @@
package com.android.internal.location.timezone;
import static android.location.timezone.ParcelableTestSupport.assertRoundTripParcelable;
import static com.android.internal.location.timezone.ParcelableTestSupport.assertRoundTripParcelable;
import org.junit.Test;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.location.timezone;
package com.android.internal.location.timezone;
import static org.junit.Assert.assertEquals;
@@ -24,7 +24,7 @@ import android.os.Parcelable;
import java.lang.reflect.Field;
/** Utility methods related to {@link Parcelable} objects used in several tests. */
public final class ParcelableTestSupport {
final class ParcelableTestSupport {
private ParcelableTestSupport() {}

View File

@@ -15,10 +15,9 @@
*/
package com.android.server.location.timezone;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static android.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_PERMANENT_FAILURE;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_SUCCESS;
import static com.android.internal.location.timezone.LocationTimeZoneEvent.EVENT_TYPE_UNCERTAIN;
import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_DISABLED;
import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_ENABLED_CERTAIN;
import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_ENABLED_INITIALIZING;
@@ -37,10 +36,10 @@ import static java.util.Arrays.asList;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.location.timezone.LocationTimeZoneEvent;
import android.platform.test.annotations.Presubmit;
import android.util.IndentingPrintWriter;
import com.android.internal.location.timezone.LocationTimeZoneEvent;
import com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.ProviderStateEnum;
import com.android.server.timezonedetector.ConfigurationInternal;
import com.android.server.timezonedetector.GeolocationTimeZoneSuggestion;