From 376a91befa178332c08b37ce0b4e4dbd7351bb6f Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 12 Aug 2020 17:46:47 +0100 Subject: Basic changes to the LocationTimeZoneProvider API These changes have been broken out as they stand alone and should be relatively uncontroversial. The LocationTimeZoneEvent is having UserHandle added, mostly for logging at this point so we can debug issues with multi-user providers. Bug: 152744911 Bug: 149014708 Test: atest services/tests/servicestests/src/android/location/timezone/LocationTimeZoneEventTest.java Change-Id: Iafbd5bc9778d68bc9c3046244e7dca6d9892519e --- .../provider/LocationTimeZoneProviderBase.java | 2 +- .../LocationTimeZoneProviderRequestUnbundled.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'location/lib/java') diff --git a/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderBase.java b/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderBase.java index 0143c88e0898..c533c20d07e3 100644 --- a/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderBase.java +++ b/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderBase.java @@ -32,7 +32,7 @@ import java.util.Objects; /** * Base class for location time zone providers implemented as unbundled services. * - * TODO Provide details of the expected service actions. + * TODO(b/152744911): Provide details of the expected service actions and threading. * *

IMPORTANT: This class is effectively a public API for unbundled applications, and must remain * API stable. diff --git a/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderRequestUnbundled.java b/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderRequestUnbundled.java index dd80466637e6..e898bbf3ecc0 100644 --- a/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderRequestUnbundled.java +++ b/location/lib/java/com/android/location/timezone/provider/LocationTimeZoneProviderRequestUnbundled.java @@ -43,6 +43,24 @@ public final class LocationTimeZoneProviderRequestUnbundled { return mRequest.getReportLocationTimeZone(); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationTimeZoneProviderRequestUnbundled that = + (LocationTimeZoneProviderRequestUnbundled) o; + return mRequest.equals(that.mRequest); + } + + @Override + public int hashCode() { + return Objects.hash(mRequest); + } + @Override public String toString() { return mRequest.toString(); -- cgit v1.2.3-59-g8ed1b