1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.util;
18 
19 import android.compat.annotation.UnsupportedAppUsage;
20 
21 /**
22  * Interface that provides trusted time information, possibly coming from an NTP
23  * server.
24  *
25  * @hide
26  * @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
27  */
28 public interface TrustedTime {
29     /**
30      * Force update with an external trusted time source, returning {@code true}
31      * when successful.
32      *
33      * @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
34      */
35     @Deprecated
36     @UnsupportedAppUsage
forceRefresh()37     public boolean forceRefresh();
38 
39     /**
40      * Check if this instance has cached a response from a trusted time source.
41      *
42      * @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
43      */
44     @Deprecated
45     @UnsupportedAppUsage
hasCache()46     boolean hasCache();
47 
48     /**
49      * Return time since last trusted time source contact, or
50      * {@link Long#MAX_VALUE} if never contacted.
51      *
52      * @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
53      */
54     @Deprecated
55     @UnsupportedAppUsage
getCacheAge()56     public long getCacheAge();
57 
58     /**
59      * Return current time similar to {@link System#currentTimeMillis()},
60      * possibly using a cached authoritative time source.
61      *
62      * @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
63      */
64     @Deprecated
65     @UnsupportedAppUsage
currentTimeMillis()66     long currentTimeMillis();
67 }
68