Loading core/java/android/app/timedetector/ITimeDetectorService.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package android.app.timedetector; import android.app.timedetector.ManualTimeSuggestion; import android.app.timedetector.NetworkTimeSuggestion; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; /** * System private API to communicate with time detector service. Loading @@ -34,7 +34,7 @@ import android.app.timedetector.PhoneTimeSuggestion; * {@hide} */ interface ITimeDetectorService { void suggestPhoneTime(in PhoneTimeSuggestion timeSuggestion); void suggestManualTime(in ManualTimeSuggestion timeSuggestion); void suggestNetworkTime(in NetworkTimeSuggestion timeSuggestion); void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion); } core/java/android/app/timedetector/PhoneTimeSuggestion.aidl→core/java/android/app/timedetector/TelephonyTimeSuggestion.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -16,4 +16,4 @@ package android.app.timedetector; parcelable PhoneTimeSuggestion; parcelable TelephonyTimeSuggestion; core/java/android/app/timedetector/PhoneTimeSuggestion.java→core/java/android/app/timedetector/TelephonyTimeSuggestion.java +24 −24 Original line number Diff line number Diff line Loading @@ -50,17 +50,17 @@ import java.util.Objects; * * @hide */ public final class PhoneTimeSuggestion implements Parcelable { public final class TelephonyTimeSuggestion implements Parcelable { /** @hide */ public static final @NonNull Parcelable.Creator<PhoneTimeSuggestion> CREATOR = new Parcelable.Creator<PhoneTimeSuggestion>() { public PhoneTimeSuggestion createFromParcel(Parcel in) { return PhoneTimeSuggestion.createFromParcel(in); public static final @NonNull Parcelable.Creator<TelephonyTimeSuggestion> CREATOR = new Parcelable.Creator<TelephonyTimeSuggestion>() { public TelephonyTimeSuggestion createFromParcel(Parcel in) { return TelephonyTimeSuggestion.createFromParcel(in); } public PhoneTimeSuggestion[] newArray(int size) { return new PhoneTimeSuggestion[size]; public TelephonyTimeSuggestion[] newArray(int size) { return new TelephonyTimeSuggestion[size]; } }; Loading @@ -68,15 +68,15 @@ public final class PhoneTimeSuggestion implements Parcelable { @Nullable private final TimestampedValue<Long> mUtcTime; @Nullable private ArrayList<String> mDebugInfo; private PhoneTimeSuggestion(Builder builder) { private TelephonyTimeSuggestion(Builder builder) { mSlotIndex = builder.mSlotIndex; mUtcTime = builder.mUtcTime; mDebugInfo = builder.mDebugInfo != null ? new ArrayList<>(builder.mDebugInfo) : null; } private static PhoneTimeSuggestion createFromParcel(Parcel in) { private static TelephonyTimeSuggestion createFromParcel(Parcel in) { int slotIndex = in.readInt(); PhoneTimeSuggestion suggestion = new PhoneTimeSuggestion.Builder(slotIndex) TelephonyTimeSuggestion suggestion = new TelephonyTimeSuggestion.Builder(slotIndex) .setUtcTime(in.readParcelable(null /* classLoader */)) .build(); @SuppressWarnings("unchecked") Loading @@ -102,7 +102,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns an identifier for the source of this suggestion. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code slotIndex}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code slotIndex}. */ public int getSlotIndex() { return mSlotIndex; Loading @@ -111,7 +111,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns the suggested time or {@code null} if there isn't one. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code utcTime}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code utcTime}. */ @Nullable public TimestampedValue<Long> getUtcTime() { Loading @@ -121,7 +121,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns debug metadata for the suggestion. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ @NonNull public List<String> getDebugInfo() { Loading @@ -132,7 +132,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Associates information with the instance that can be useful for debugging / logging. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ public void addDebugInfo(@NonNull String debugInfo) { if (mDebugInfo == null) { Loading @@ -144,7 +144,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Associates information with the instance that can be useful for debugging / logging. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ public void addDebugInfo(@NonNull List<String> debugInfo) { if (mDebugInfo == null) { Loading @@ -161,7 +161,7 @@ public final class PhoneTimeSuggestion implements Parcelable { if (o == null || getClass() != o.getClass()) { return false; } PhoneTimeSuggestion that = (PhoneTimeSuggestion) o; TelephonyTimeSuggestion that = (TelephonyTimeSuggestion) o; return mSlotIndex == that.mSlotIndex && Objects.equals(mUtcTime, that.mUtcTime); } Loading @@ -173,7 +173,7 @@ public final class PhoneTimeSuggestion implements Parcelable { @Override public String toString() { return "PhoneTimeSuggestion{" return "TelephonyTimeSuggestion{" + "mSlotIndex='" + mSlotIndex + '\'' + ", mUtcTime=" + mUtcTime + ", mDebugInfo=" + mDebugInfo Loading @@ -181,7 +181,7 @@ public final class PhoneTimeSuggestion implements Parcelable { } /** * Builds {@link PhoneTimeSuggestion} instances. * Builds {@link TelephonyTimeSuggestion} instances. * * @hide */ Loading @@ -193,7 +193,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Creates a builder with the specified {@code slotIndex}. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code slotIndex}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code slotIndex}. */ public Builder(int slotIndex) { mSlotIndex = slotIndex; Loading @@ -202,7 +202,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns the builder for call chaining. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code utcTime}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code utcTime}. */ @NonNull public Builder setUtcTime(@Nullable TimestampedValue<Long> utcTime) { Loading @@ -218,7 +218,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns the builder for call chaining. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ @NonNull public Builder addDebugInfo(@NonNull String debugInfo) { Loading @@ -229,10 +229,10 @@ public final class PhoneTimeSuggestion implements Parcelable { return this; } /** Returns the {@link PhoneTimeSuggestion}. */ /** Returns the {@link TelephonyTimeSuggestion}. */ @NonNull public PhoneTimeSuggestion build() { return new PhoneTimeSuggestion(this); public TelephonyTimeSuggestion build() { return new TelephonyTimeSuggestion(this); } } } core/java/android/app/timedetector/TimeDetector.java +5 −5 Original line number Diff line number Diff line Loading @@ -45,12 +45,12 @@ public interface TimeDetector { } /** * Suggests the current phone-signal derived time to the detector. The detector may ignore the * signal if better signals are available such as those that come from more reliable sources or * were determined more recently. * Suggests a telephony-signal derived time to the detector. The detector may ignore the signal * if better signals are available such as those that come from more reliable sources or were * determined more recently. */ @RequiresPermission(android.Manifest.permission.SUGGEST_PHONE_TIME_AND_ZONE) void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion); @RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE) void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion); /** * Suggests the user's manually entered current time to the detector. Loading core/java/android/app/timedetector/TimeDetectorImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -40,12 +40,12 @@ public final class TimeDetectorImpl implements TimeDetector { } @Override public void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion) { public void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion) { if (DEBUG) { Log.d(TAG, "suggestPhoneTime called: " + timeSuggestion); Log.d(TAG, "suggestTelephonyTime called: " + timeSuggestion); } try { mITimeDetectorService.suggestPhoneTime(timeSuggestion); mITimeDetectorService.suggestTelephonyTime(timeSuggestion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading
core/java/android/app/timedetector/ITimeDetectorService.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package android.app.timedetector; import android.app.timedetector.ManualTimeSuggestion; import android.app.timedetector.NetworkTimeSuggestion; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; /** * System private API to communicate with time detector service. Loading @@ -34,7 +34,7 @@ import android.app.timedetector.PhoneTimeSuggestion; * {@hide} */ interface ITimeDetectorService { void suggestPhoneTime(in PhoneTimeSuggestion timeSuggestion); void suggestManualTime(in ManualTimeSuggestion timeSuggestion); void suggestNetworkTime(in NetworkTimeSuggestion timeSuggestion); void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion); }
core/java/android/app/timedetector/PhoneTimeSuggestion.aidl→core/java/android/app/timedetector/TelephonyTimeSuggestion.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -16,4 +16,4 @@ package android.app.timedetector; parcelable PhoneTimeSuggestion; parcelable TelephonyTimeSuggestion;
core/java/android/app/timedetector/PhoneTimeSuggestion.java→core/java/android/app/timedetector/TelephonyTimeSuggestion.java +24 −24 Original line number Diff line number Diff line Loading @@ -50,17 +50,17 @@ import java.util.Objects; * * @hide */ public final class PhoneTimeSuggestion implements Parcelable { public final class TelephonyTimeSuggestion implements Parcelable { /** @hide */ public static final @NonNull Parcelable.Creator<PhoneTimeSuggestion> CREATOR = new Parcelable.Creator<PhoneTimeSuggestion>() { public PhoneTimeSuggestion createFromParcel(Parcel in) { return PhoneTimeSuggestion.createFromParcel(in); public static final @NonNull Parcelable.Creator<TelephonyTimeSuggestion> CREATOR = new Parcelable.Creator<TelephonyTimeSuggestion>() { public TelephonyTimeSuggestion createFromParcel(Parcel in) { return TelephonyTimeSuggestion.createFromParcel(in); } public PhoneTimeSuggestion[] newArray(int size) { return new PhoneTimeSuggestion[size]; public TelephonyTimeSuggestion[] newArray(int size) { return new TelephonyTimeSuggestion[size]; } }; Loading @@ -68,15 +68,15 @@ public final class PhoneTimeSuggestion implements Parcelable { @Nullable private final TimestampedValue<Long> mUtcTime; @Nullable private ArrayList<String> mDebugInfo; private PhoneTimeSuggestion(Builder builder) { private TelephonyTimeSuggestion(Builder builder) { mSlotIndex = builder.mSlotIndex; mUtcTime = builder.mUtcTime; mDebugInfo = builder.mDebugInfo != null ? new ArrayList<>(builder.mDebugInfo) : null; } private static PhoneTimeSuggestion createFromParcel(Parcel in) { private static TelephonyTimeSuggestion createFromParcel(Parcel in) { int slotIndex = in.readInt(); PhoneTimeSuggestion suggestion = new PhoneTimeSuggestion.Builder(slotIndex) TelephonyTimeSuggestion suggestion = new TelephonyTimeSuggestion.Builder(slotIndex) .setUtcTime(in.readParcelable(null /* classLoader */)) .build(); @SuppressWarnings("unchecked") Loading @@ -102,7 +102,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns an identifier for the source of this suggestion. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code slotIndex}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code slotIndex}. */ public int getSlotIndex() { return mSlotIndex; Loading @@ -111,7 +111,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns the suggested time or {@code null} if there isn't one. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code utcTime}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code utcTime}. */ @Nullable public TimestampedValue<Long> getUtcTime() { Loading @@ -121,7 +121,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns debug metadata for the suggestion. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ @NonNull public List<String> getDebugInfo() { Loading @@ -132,7 +132,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Associates information with the instance that can be useful for debugging / logging. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ public void addDebugInfo(@NonNull String debugInfo) { if (mDebugInfo == null) { Loading @@ -144,7 +144,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Associates information with the instance that can be useful for debugging / logging. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ public void addDebugInfo(@NonNull List<String> debugInfo) { if (mDebugInfo == null) { Loading @@ -161,7 +161,7 @@ public final class PhoneTimeSuggestion implements Parcelable { if (o == null || getClass() != o.getClass()) { return false; } PhoneTimeSuggestion that = (PhoneTimeSuggestion) o; TelephonyTimeSuggestion that = (TelephonyTimeSuggestion) o; return mSlotIndex == that.mSlotIndex && Objects.equals(mUtcTime, that.mUtcTime); } Loading @@ -173,7 +173,7 @@ public final class PhoneTimeSuggestion implements Parcelable { @Override public String toString() { return "PhoneTimeSuggestion{" return "TelephonyTimeSuggestion{" + "mSlotIndex='" + mSlotIndex + '\'' + ", mUtcTime=" + mUtcTime + ", mDebugInfo=" + mDebugInfo Loading @@ -181,7 +181,7 @@ public final class PhoneTimeSuggestion implements Parcelable { } /** * Builds {@link PhoneTimeSuggestion} instances. * Builds {@link TelephonyTimeSuggestion} instances. * * @hide */ Loading @@ -193,7 +193,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Creates a builder with the specified {@code slotIndex}. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code slotIndex}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code slotIndex}. */ public Builder(int slotIndex) { mSlotIndex = slotIndex; Loading @@ -202,7 +202,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns the builder for call chaining. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code utcTime}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code utcTime}. */ @NonNull public Builder setUtcTime(@Nullable TimestampedValue<Long> utcTime) { Loading @@ -218,7 +218,7 @@ public final class PhoneTimeSuggestion implements Parcelable { /** * Returns the builder for call chaining. * * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}. * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}. */ @NonNull public Builder addDebugInfo(@NonNull String debugInfo) { Loading @@ -229,10 +229,10 @@ public final class PhoneTimeSuggestion implements Parcelable { return this; } /** Returns the {@link PhoneTimeSuggestion}. */ /** Returns the {@link TelephonyTimeSuggestion}. */ @NonNull public PhoneTimeSuggestion build() { return new PhoneTimeSuggestion(this); public TelephonyTimeSuggestion build() { return new TelephonyTimeSuggestion(this); } } }
core/java/android/app/timedetector/TimeDetector.java +5 −5 Original line number Diff line number Diff line Loading @@ -45,12 +45,12 @@ public interface TimeDetector { } /** * Suggests the current phone-signal derived time to the detector. The detector may ignore the * signal if better signals are available such as those that come from more reliable sources or * were determined more recently. * Suggests a telephony-signal derived time to the detector. The detector may ignore the signal * if better signals are available such as those that come from more reliable sources or were * determined more recently. */ @RequiresPermission(android.Manifest.permission.SUGGEST_PHONE_TIME_AND_ZONE) void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion); @RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE) void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion); /** * Suggests the user's manually entered current time to the detector. Loading
core/java/android/app/timedetector/TimeDetectorImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -40,12 +40,12 @@ public final class TimeDetectorImpl implements TimeDetector { } @Override public void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion) { public void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion) { if (DEBUG) { Log.d(TAG, "suggestPhoneTime called: " + timeSuggestion); Log.d(TAG, "suggestTelephonyTime called: " + timeSuggestion); } try { mITimeDetectorService.suggestPhoneTime(timeSuggestion); mITimeDetectorService.suggestTelephonyTime(timeSuggestion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading