• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2023 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
16/**
17 * MissionCallback registered by app.
18 *
19 * @interface MissionCallback
20 * @permission ohos.permission.MANAGE_MISSIONS
21 * @syscap SystemCapability.Ability.AbilityRuntime.Mission
22 * @systemapi
23 * @since 9
24 */
25export interface MissionCallback {
26  /**
27   * Called by system when mission changed.
28   *
29   * @permission ohos.permission.MANAGE_MISSIONS
30   * @param { string } deviceId - Indicates the deviceId mission changed.
31   * @syscap SystemCapability.Ability.AbilityRuntime.Mission
32   * @systemapi
33   * @since 9
34   */
35  notifyMissionsChanged(deviceId: string): void;
36
37  /**
38   * Called by system when snapshot changed.
39   *
40   * @permission ohos.permission.MANAGE_MISSIONS
41   * @param { string } deviceId - Indicates the deviceId mission changed.
42   * @param { number } mission - Indicates the id of destroyed mission.
43   * @syscap SystemCapability.Ability.AbilityRuntime.Mission
44   * @systemapi
45   * @since 9
46   */
47  notifySnapshot(deviceId: string, mission: number): void;
48
49  /**
50   * Called by system when network disconnect.
51   *
52   * @permission ohos.permission.MANAGE_MISSIONS
53   * @param { string } deviceId - Indicates the deviceId mission changed.
54   * @param { number } state - Indicates the state of network
55   * @syscap SystemCapability.Ability.AbilityRuntime.Mission
56   * @systemapi
57   * @since 9
58   */
59  notifyNetDisconnect(deviceId: string, state: number): void;
60}
61