• 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 OHOS.AbilityRuntime.WantAgent.WantAgent;
19interface OHOS.MiscServices.ITimeService {
20    void SetTime([in] long time, [in] byte apiVersion);
21    void SetTimeZone([in] String timezoneId, [in] byte apiVersion);
22    void GetTimeZone([out] String timezoneId);
23    void GetThreadTimeMs([out] long time);
24    void GetThreadTimeNs([out] long time);
25    void CreateTimer([in] String name, [in] int type, [in] boolean repeat, [in] boolean disposable,
26                     [in] boolean autoRestore, [in] unsigned long interval, [in] WantAgent wantAgent,
27                     [in] IRemoteObject timerCallback, [inout] unsigned long timerId);
28    void CreateTimerWithoutWA([in] String name, [in] int type, [in] boolean repeat, [in] boolean disposable,
29                     [in] boolean autoRestore, [in] unsigned long interval, [in] IRemoteObject timerCallback,
30                     [inout] unsigned long timerId);
31    void StartTimer([in] unsigned long timerId, [in] unsigned long triggerTime);
32    void StopTimer([in] unsigned long timerId);
33    void DestroyTimer([in] unsigned long timerId);
34    [oneway] void DestroyTimerAsync([in] unsigned long timerId);
35    void ProxyTimer([in] int uid, [in] List<int> pidVector, [in] boolean isProxy, [in] boolean needRetrigger);
36    void ResetAllProxy();
37    void AdjustTimer([in] boolean isAdjust, [in] unsigned int interval, [in] unsigned int delta);
38    void SetTimerExemption([in] List<String> nameArr, [in] boolean isExemption);
39    void GetNtpTimeMs([out] long time);
40    void GetRealTimeMs([out] long time);
41}
42