Merge "Misc tidy up before adding geolocation classes"

This commit is contained in:
Neil Fuller
2020-03-20 09:47:19 +00:00
committed by Gerrit Code Review
6 changed files with 79 additions and 76 deletions

View File

@@ -30,7 +30,7 @@ import java.util.List;
import java.util.Objects;
/**
* A time signal from a manual (user provided) source.
* A time zone suggestion from a manual (user provided) source.
*
* <p>{@code zoneId} contains the suggested time zone ID, e.g. "America/Los_Angeles".
*
@@ -124,7 +124,7 @@ public final class ManualTimeZoneSuggestion implements Parcelable {
@Override
public String toString() {
return "ManualTimeSuggestion{"
return "ManualTimeZoneSuggestion{"
+ "mZoneId=" + mZoneId
+ ", mDebugInfo=" + mDebugInfo
+ '}';

View File

@@ -40,6 +40,15 @@ public interface TimeZoneDetector {
return suggestion;
}
/**
* Suggests the current time zone, determined using the user's manually entered information, to
* the detector. The detector may ignore the signal based on system settings.
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE)
void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion);
/**
* Suggests the current time zone, determined using telephony signals, to the detector. The
* detector may ignore the signal based on system settings, whether better information is
@@ -49,13 +58,4 @@ public interface TimeZoneDetector {
*/
@RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE)
void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion);
/**
* Suggests the current time zone, determined for the user's manually information, to the
* detector. The detector may ignore the signal based on system settings.
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE)
void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion);
}

View File

@@ -39,18 +39,6 @@ public final class TimeZoneDetectorImpl implements TimeZoneDetector {
ServiceManager.getServiceOrThrow(Context.TIME_ZONE_DETECTOR_SERVICE));
}
@Override
public void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion) {
if (DEBUG) {
Log.d(TAG, "suggestTelephonyTimeZone called: " + timeZoneSuggestion);
}
try {
mITimeZoneDetectorService.suggestTelephonyTimeZone(timeZoneSuggestion);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion) {
if (DEBUG) {
@@ -62,4 +50,16 @@ public final class TimeZoneDetectorImpl implements TimeZoneDetector {
throw e.rethrowFromSystemServer();
}
}
@Override
public void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion) {
if (DEBUG) {
Log.d(TAG, "suggestTelephonyTimeZone called: " + timeZoneSuggestion);
}
try {
mITimeZoneDetectorService.suggestTelephonyTimeZone(timeZoneSuggestion);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}