Loading core/java/android/app/timezonedetector/ManualTimeZoneSuggestion.java +2 −2 Original line number Diff line number Diff line Loading @@ -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". * Loading Loading @@ -124,7 +124,7 @@ public final class ManualTimeZoneSuggestion implements Parcelable { @Override public String toString() { return "ManualTimeSuggestion{" return "ManualTimeZoneSuggestion{" + "mZoneId=" + mZoneId + ", mDebugInfo=" + mDebugInfo + '}'; Loading core/java/android/app/timezonedetector/TimeZoneDetector.java +9 −9 Original line number Diff line number Diff line Loading @@ -41,21 +41,21 @@ public interface TimeZoneDetector { } /** * 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 * available, and so on. * 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_TELEPHONY_TIME_AND_ZONE) void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion); @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE) void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion 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. * 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 * available, and so on. * * @hide */ @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE) void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion); @RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE) void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion); } core/java/android/app/timezonedetector/TimeZoneDetectorImpl.java +6 −6 Original line number Diff line number Diff line Loading @@ -40,24 +40,24 @@ public final class TimeZoneDetectorImpl implements TimeZoneDetector { } @Override public void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion) { public void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion) { if (DEBUG) { Log.d(TAG, "suggestTelephonyTimeZone called: " + timeZoneSuggestion); Log.d(TAG, "suggestManualTimeZone called: " + timeZoneSuggestion); } try { mITimeZoneDetectorService.suggestTelephonyTimeZone(timeZoneSuggestion); mITimeZoneDetectorService.suggestManualTimeZone(timeZoneSuggestion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion) { public void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion) { if (DEBUG) { Log.d(TAG, "suggestManualTimeZone called: " + timeZoneSuggestion); Log.d(TAG, "suggestTelephonyTimeZone called: " + timeZoneSuggestion); } try { mITimeZoneDetectorService.suggestManualTimeZone(timeZoneSuggestion); mITimeZoneDetectorService.suggestTelephonyTimeZone(timeZoneSuggestion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/tests/coretests/src/android/app/timezonedetector/TelephonyTimeZoneSuggestionTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public class TelephonyTimeZoneSuggestionTest { } @Test(expected = RuntimeException.class) public void testBuilderValidates_emptyZone_badMatchType() { public void testBuilderValidates_nullZone_badMatchType() { TelephonyTimeZoneSuggestion.Builder builder = new TelephonyTimeZoneSuggestion.Builder(SLOT_INDEX); // No zone ID, so match type should be left unset. Loading services/core/java/com/android/server/timezonedetector/TimeZoneDetectorStrategy.java +8 −4 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ import android.app.timezonedetector.TelephonyTimeZoneSuggestion; import java.io.PrintWriter; /** * The interface for the class that implement the time detection algorithm used by the * The interface for the class that implements the time detection algorithm used by the * {@link TimeZoneDetectorService}. * * <p>The strategy uses suggestions to decide whether to modify the device's time zone setting * and what to set it to. * * <p>Most calls will be handled by a single thread but that is not true for all calls. For example * {@link #dump(PrintWriter, String[])}) may be called on a different thread so implementations must * handle thread safety. Loading @@ -33,7 +36,9 @@ import java.io.PrintWriter; */ public interface TimeZoneDetectorStrategy { /** Process the suggested manually-entered (i.e. user sourced) time zone. */ /** * Suggests a time zone for the device using manually-entered (i.e. user sourced) information. */ void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion suggestion); /** Loading @@ -41,8 +46,7 @@ public interface TimeZoneDetectorStrategy { * {@link TelephonyTimeZoneSuggestion#getZoneId()} is {@code null}. The suggestion is scoped to * a specific {@link TelephonyTimeZoneSuggestion#getSlotIndex() slotIndex}. * See {@link TelephonyTimeZoneSuggestion} for an explanation of the metadata associated with a * suggestion. The strategy uses suggestions to decide whether to modify the device's time zone * setting and what to set it to. * suggestion. */ void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion suggestion); Loading Loading
core/java/android/app/timezonedetector/ManualTimeZoneSuggestion.java +2 −2 Original line number Diff line number Diff line Loading @@ -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". * Loading Loading @@ -124,7 +124,7 @@ public final class ManualTimeZoneSuggestion implements Parcelable { @Override public String toString() { return "ManualTimeSuggestion{" return "ManualTimeZoneSuggestion{" + "mZoneId=" + mZoneId + ", mDebugInfo=" + mDebugInfo + '}'; Loading
core/java/android/app/timezonedetector/TimeZoneDetector.java +9 −9 Original line number Diff line number Diff line Loading @@ -41,21 +41,21 @@ public interface TimeZoneDetector { } /** * 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 * available, and so on. * 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_TELEPHONY_TIME_AND_ZONE) void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion); @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE) void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion 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. * 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 * available, and so on. * * @hide */ @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE) void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion); @RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE) void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion); }
core/java/android/app/timezonedetector/TimeZoneDetectorImpl.java +6 −6 Original line number Diff line number Diff line Loading @@ -40,24 +40,24 @@ public final class TimeZoneDetectorImpl implements TimeZoneDetector { } @Override public void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion) { public void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion) { if (DEBUG) { Log.d(TAG, "suggestTelephonyTimeZone called: " + timeZoneSuggestion); Log.d(TAG, "suggestManualTimeZone called: " + timeZoneSuggestion); } try { mITimeZoneDetectorService.suggestTelephonyTimeZone(timeZoneSuggestion); mITimeZoneDetectorService.suggestManualTimeZone(timeZoneSuggestion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion) { public void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion) { if (DEBUG) { Log.d(TAG, "suggestManualTimeZone called: " + timeZoneSuggestion); Log.d(TAG, "suggestTelephonyTimeZone called: " + timeZoneSuggestion); } try { mITimeZoneDetectorService.suggestManualTimeZone(timeZoneSuggestion); mITimeZoneDetectorService.suggestTelephonyTimeZone(timeZoneSuggestion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/tests/coretests/src/android/app/timezonedetector/TelephonyTimeZoneSuggestionTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public class TelephonyTimeZoneSuggestionTest { } @Test(expected = RuntimeException.class) public void testBuilderValidates_emptyZone_badMatchType() { public void testBuilderValidates_nullZone_badMatchType() { TelephonyTimeZoneSuggestion.Builder builder = new TelephonyTimeZoneSuggestion.Builder(SLOT_INDEX); // No zone ID, so match type should be left unset. Loading
services/core/java/com/android/server/timezonedetector/TimeZoneDetectorStrategy.java +8 −4 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ import android.app.timezonedetector.TelephonyTimeZoneSuggestion; import java.io.PrintWriter; /** * The interface for the class that implement the time detection algorithm used by the * The interface for the class that implements the time detection algorithm used by the * {@link TimeZoneDetectorService}. * * <p>The strategy uses suggestions to decide whether to modify the device's time zone setting * and what to set it to. * * <p>Most calls will be handled by a single thread but that is not true for all calls. For example * {@link #dump(PrintWriter, String[])}) may be called on a different thread so implementations must * handle thread safety. Loading @@ -33,7 +36,9 @@ import java.io.PrintWriter; */ public interface TimeZoneDetectorStrategy { /** Process the suggested manually-entered (i.e. user sourced) time zone. */ /** * Suggests a time zone for the device using manually-entered (i.e. user sourced) information. */ void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion suggestion); /** Loading @@ -41,8 +46,7 @@ public interface TimeZoneDetectorStrategy { * {@link TelephonyTimeZoneSuggestion#getZoneId()} is {@code null}. The suggestion is scoped to * a specific {@link TelephonyTimeZoneSuggestion#getSlotIndex() slotIndex}. * See {@link TelephonyTimeZoneSuggestion} for an explanation of the metadata associated with a * suggestion. The strategy uses suggestions to decide whether to modify the device's time zone * setting and what to set it to. * suggestion. */ void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion suggestion); Loading