1 /* 2 * Copyright (c) 2021 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 #ifndef OHOS_ABILITY_RUNTIME_CONTINUATION_STATE_H 16 #define OHOS_ABILITY_RUNTIME_CONTINUATION_STATE_H 17 namespace OHOS { 18 namespace AppExecFwk { 19 /** 20 * Enumerates the migration states of an {@link Ability} that has implemented {@link IAbilityContinuation} 21 * and is in a reversible migration process that allows the ability to be migrated back. 22 * 23 * <p>The following example describes state changes in a migration process: 24 * <p>The initial state of {@code FooAbility} on device A is {@link #LOCAL_RUNNING}. If it is migrated to 25 * device B in a reversible way, its state on device A becomes {@link #REMOTE_RUNNING} and that on device 26 * B becomes {@link #REPLICA_RUNNING}. If it is migrated to device B in a non-reversible way, its states 27 * on both devices are {@link #LOCAL_RUNNING}. 28 * 29 * @Syscap {@link SystemCapability.Aafwk#ABILITY} 30 */ 31 enum class ContinuationState { 32 // Indicates that the ability is running on the local device. 33 LOCAL_RUNNING = 0, 34 35 // Indicates that the ability has been migrated to another device. 36 REMOTE_RUNNING = 1, 37 38 // Indicates that the ability was migrated from another device to the current device. 39 REPLICA_RUNNING = 2, 40 }; 41 using DEVICE_CONNECT_STATE = enum ContinuationState; 42 } // namespace AppExecFwk 43 } // namespace OHOS 44 #endif // OHOS_ABILITY_RUNTIME_CONTINUATION_STATE_H 45