1 /*
2  * Copyright (C) 2018 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.app.timedetector;
18 
19 import android.app.time.ExternalTimeSuggestion;
20 import android.app.time.ITimeDetectorListener;
21 import android.app.time.TimeCapabilitiesAndConfig;
22 import android.app.time.TimeConfiguration;
23 import android.app.time.TimeState;
24 import android.app.time.UnixEpochTime;
25 import android.app.timedetector.ManualTimeSuggestion;
26 import android.app.timedetector.TelephonyTimeSuggestion;
27 
28 /**
29  * Binder APIs to communicate with the time detector service.
30  *
31  * <p>Used to provide information to the Time Detector Service from other parts of the Android
32  * system that have access to time-related signals, e.g. telephony. Over time, System APIs have
33  * been added to support unbundled parts of the platform, e.g. SetUp Wizard.
34  *
35  * <p>Use the {@link android.app.timedetector.TimeDetector} (internal API) and
36  * {@link android.app.time.TimeManager} (system API) classes rather than going through this Binder
37  * interface directly. See {@link android.app.timedetector.TimeDetectorService} for more complete
38  * documentation.
39  *
40  * {@hide}
41  */
42 interface ITimeDetectorService {
getCapabilitiesAndConfig()43   TimeCapabilitiesAndConfig getCapabilitiesAndConfig();
addListener(ITimeDetectorListener listener)44   void addListener(ITimeDetectorListener listener);
removeListener(ITimeDetectorListener listener)45   void removeListener(ITimeDetectorListener listener);
46 
updateConfiguration(in TimeConfiguration timeConfiguration)47   boolean updateConfiguration(in TimeConfiguration timeConfiguration);
48 
getTimeState()49   TimeState getTimeState();
confirmTime(in UnixEpochTime time)50   boolean confirmTime(in UnixEpochTime time);
setManualTime(in ManualTimeSuggestion timeZoneSuggestion)51   boolean setManualTime(in ManualTimeSuggestion timeZoneSuggestion);
52 
suggestExternalTime(in ExternalTimeSuggestion timeSuggestion)53   void suggestExternalTime(in ExternalTimeSuggestion timeSuggestion);
suggestManualTime(in ManualTimeSuggestion timeSuggestion)54   boolean suggestManualTime(in ManualTimeSuggestion timeSuggestion);
suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion)55   void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion);
56 
latestNetworkTime()57   UnixEpochTime latestNetworkTime();
58 }
59