1/* 2 * Copyright (c) 2022 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 * @addtogroup HdiActivityRecognition 18 * @{ 19 * 20 * @brief Provides APIs for subscribing to and obtaining user activities. 21 * 22 * The Multimodal Sensor Data Platform (MSDP) can obtain the object or proxy of the activity recognition driver, 23 * and call the APIs provided by the object or proxy to obtain activities supported by the device, 24 * the current activity event of the device, and activity events cached on the device, 25 * and subscribe to or unsubscribe from activity events. 26 * 27 * @since 3.2 28 * @version 1.0 29 */ 30 31/** 32 * @file IActivityChangedCallback.idl 33 * 34 * @brief Declares the callback for reporting activity recognition data. 35 * 36 * To subscribe to activity data, an instance of this callback must be registered. 37 * 38 * @since 3.2 39 * @version 1.0 40 */ 41 42/** 43 * @brief Defines the package path of the activity recognition module APIs. 44 * 45 * @since 3.2 46 */ 47package ohos.hdi.activity_recognition.v1_0; 48 49import ohos.hdi.activity_recognition.v1_0.ActivityRecognitionTypes; 50 51/** 52 * @brief Defines the callback for reporting activity events. 53 * 54 * Before obtaining the current activity event or the activity events cached on the device, you must register this 55 * callback.The activity data is reported through the callback when the specified activity event occurs. 56 * For details, see {@link IActivityInterface}. 57 * 58 * @since 3.2 59 */ 60 61[callback] interface IActivityChangedCallback { 62 /** 63 * @brief Called when an activity event occurs. 64 * 65 * 66 * 67 * @param event Indicates the data to report. For details, see {@link ActRecognitionEvent}. 68 * 69 * @return Returns <b>0</b> if the operation is successful. 70 * @return Returns a negative value if the operation fails. 71 * 72 * @since 3.2 73 */ 74 OnActivityChanged([in] struct ActRecognitionEvent[] event); 75} 76/** @} */