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
This commit is contained in:
Neil Fuller
2020-08-12 17:46:47 +01:00
parent e076ada0c7
commit 376a91befa
4 changed files with 86 additions and 15 deletions

View File

@@ -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.
*
* <p>IMPORTANT: This class is effectively a public API for unbundled applications, and must remain
* API stable.

View File

@@ -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();