Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08466f61 authored by Almaz Mingaleev's avatar Almaz Mingaleev Committed by Gerrit Code Review
Browse files

Merge "Make manual suggestions synchronous/return result"

parents 1fe717a5 1395dffd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import android.app.timedetector.TelephonyTimeSuggestion;
 * {@hide}
 */
interface ITimeDetectorService {
  void suggestManualTime(in ManualTimeSuggestion timeSuggestion);
  boolean suggestManualTime(in ManualTimeSuggestion timeSuggestion);
  void suggestNetworkTime(in NetworkTimeSuggestion timeSuggestion);
  void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion);
}
+6 −2
Original line number Diff line number Diff line
@@ -53,12 +53,16 @@ public interface TimeDetector {
    void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion);

    /**
     * Suggests the user's manually entered current time to the detector.
     * Suggests the current time, determined from the user's manually entered information, to
     * the detector. Returns {@code false} if the suggestion was invalid, or the device
     * configuration prevented the suggestion being used, {@code true} if the suggestion was
     * accepted. A suggestion that is valid but does not change the time because it matches the
     * current device time is considered accepted.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE)
    void suggestManualTime(@NonNull ManualTimeSuggestion timeSuggestion);
    boolean suggestManualTime(@NonNull ManualTimeSuggestion timeSuggestion);

    /**
     * Suggests the time according to a network time source like NTP.
+2 −2
Original line number Diff line number Diff line
@@ -52,12 +52,12 @@ public final class TimeDetectorImpl implements TimeDetector {
    }

    @Override
    public void suggestManualTime(@NonNull ManualTimeSuggestion timeSuggestion) {
    public boolean suggestManualTime(@NonNull ManualTimeSuggestion timeSuggestion) {
        if (DEBUG) {
            Log.d(TAG, "suggestManualTime called: " + timeSuggestion);
        }
        try {
            mITimeDetectorService.suggestManualTime(timeSuggestion);
            return mITimeDetectorService.suggestManualTime(timeSuggestion);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+1 −1
Original line number Diff line number Diff line
@@ -33,6 +33,6 @@ import android.app.timezonedetector.TelephonyTimeZoneSuggestion;
 * {@hide}
 */
interface ITimeZoneDetectorService {
  void suggestManualTimeZone(in ManualTimeZoneSuggestion timeZoneSuggestion);
  boolean suggestManualTimeZone(in ManualTimeZoneSuggestion timeZoneSuggestion);
  void suggestTelephonyTimeZone(in TelephonyTimeZoneSuggestion timeZoneSuggestion);
}
+6 −3
Original line number Diff line number Diff line
@@ -41,13 +41,16 @@ public interface TimeZoneDetector {
    }

    /**
     * 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.
     * Suggests the current time zone, determined from the user's manually entered information, to
     * the detector. Returns {@code false} if the suggestion was invalid, or the device
     * configuration prevented the suggestion being used, {@code true} if the suggestion was
     * accepted. A suggestion that is valid but does not change the time zone because it matches
     * the current device time zone is considered accepted.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE)
    void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion);
    boolean suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion);

    /**
     * Suggests the current time zone, determined using telephony signals, to the detector. The
Loading