• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import ITimerCallback;
17sequenceable OHOS.IRemoteObject;
18sequenceable SimpleTimerInfo..OHOS.MiscServices.SimpleTimerInfo;
19sequenceable OHOS.AbilityRuntime.WantAgent.WantAgent;
20interface OHOS.MiscServices.ITimeService {
21    void SetTime([in] long time, [in] byte apiVersion);
22    void SetTimeZone([in] String timezoneId, [in] byte apiVersion);
23    void GetTimeZone([out] String timezoneId);
24    void GetThreadTimeMs([out] long time);
25    void GetThreadTimeNs([out] long time);
26    void CreateTimer([in] SimpleTimerInfo simpleTimerInfo, [in] IRemoteObject timerCallback, [inout] unsigned long timerId);
27    void StartTimer([in] unsigned long timerId, [in] unsigned long triggerTime);
28    void StopTimer([in] unsigned long timerId);
29    void DestroyTimer([in] unsigned long timerId);
30    [oneway] void DestroyTimerAsync([in] unsigned long timerId);
31    void ProxyTimer([in] int uid, [in] List<int> pidVector, [in] boolean isProxy, [in] boolean needRetrigger);
32    void ResetAllProxy();
33    void AdjustTimer([in] boolean isAdjust, [in] unsigned int interval, [in] unsigned int delta);
34    void SetTimerExemption([in] List<String> nameArr, [in] boolean isExemption);
35    void GetNtpTimeMs([out] long time);
36    void GetRealTimeMs([out] long time);
37}
38