1# MSDP Subsystem Changelog 2 3## c1.device_status.1 Screen Hopping APIs Deprecated 4 5**Access Level** 6 7System APIs 8 9**Reason for Change** 10 11Permission control is added for screen hopping APIs. The new APIs incorporate complete functions of the old system APIs and are more standard and atomic with full compliance with community API specifications. 12 13**Change Impact** 14 15The change is not compatible with earlier versions. You are advised to use new APIs. 16 17**Valid Since** 18 19OpenHarmony SDK 4.1.5.1 20 21**Deprecated APIs** 22 23| API | Description | Substitute API | 24| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | 25| function prepare(callback: AsyncCallback<void>): void; | **cooperate.prepareCooperate** is used to prepare for screen hopping. | function prepareCooperate(callback: AsyncCallback<void>): void; | 26| function prepare(): Promise<void>; | **cooperate.prepareCooperate** is used to prepare for screen hopping. | function prepareCooperate(): Promise<void>; | 27| function unprepare(callback: AsyncCallback<void>): void; | **cooperate.unprepareCooperate** is used to cancel the preparation for screen hopping. | function unprepareCooperate(callback: AsyncCallback<void>): void; | 28| function unprepare(): Promise<void>; | **cooperate.unprepareCooperate** is used to cancel the preparation for screen hopping. | function unprepareCooperate(): Promise<void>; | 29| function activate(targetNetworkId: string, inputDeviceId: number, callback: AsyncCallback<void>): void; | **cooperate.activateCooperate** is used to start screen hopping. | function activateCooperate(targetNetworkId: string, inputDeviceId: number, callback: AsyncCallback<void>): void; | 30| function activate(targetNetworkId: string, inputDeviceId: number): Promise<void>; | **cooperate.activateCooperate** is used to start screen hopping. | function activateCooperate(targetNetworkId: string, inputDeviceId: number): Promise<void>; | 31| function deactivate(isUnchained: boolean, callback: AsyncCallback<void>): void; | **cooperate.deactivateCooperate** is used to stop screen hopping. | function deactivateCooperate(isUnchained: boolean, callback: AsyncCallback<void>): void; | 32| function deactivate(isUnchained: boolean): Promise<void>; | **cooperate.deactivateCooperate** is used to stop screen hopping. | function deactivateCooperate(isUnchained: boolean): Promise<void>; | 33| function getCrossingSwitchState(networkId: string, callback: AsyncCallback<boolean>): void; | **cooperate.getCooperateSwitchState** is used to obtain the screen hopping status of the target device.| function getCooperateSwitchState(networkId: string, callback: AsyncCallback<boolean>): void; | 34| function getCrossingSwitchState(networkId: string): Promise<boolean>; | **cooperate.getCooperateSwitchState** is used to obtain the screen hopping status of the target device.| function getCooperateSwitchState(networkId: string): Promise<boolean>; | 35| function on(type: 'cooperate', callback: Callback<{ networkId: string, msg: CooperateMsg }>): void; | **cooperate.on** is used to subscribe to screen hopping status change events. | function on(type: 'cooperateMessage', callback: Callback<CooperateMessage>): void; | 36| function off(type: 'cooperate', callback?: Callback<void>): void; | **cooperate.off** is used to unsubscribe from screen hopping status change events. | function off(type: 'cooperateMessage', callback?: Callback<CooperateMessage>): void; | 37| enum CooperateMsg | **CooperateMessage** is used to define a screen hopping status change event. | interface CooperateMessage | 38| COOPERATE_PREPARE | **CooperateState.COOPERATE_PREPARE** is used to indicate that the preparation for screen hopping is finished. | CooperateState.COOPERATE_PREPARE | 39| COOPERATE_UNPREPARE | **CooperateState.COOPERATE_UNPREPARE** is used to indicate that the preparation for screen hopping is canceled. | CooperateState.COOPERATE_UNPREPARE | 40| COOPERATE_ACTIVATE | **CooperateState.COOPERATE_ACTIVATE** is used to indicate that screen hopping is started. | CooperateState.COOPERATE_ACTIVATE | 41| COOPERATE_ACTIVATE_SUCCESS | **CooperateState.COOPERATE_ACTIVATE_SUCCESS** is used to indicate that starting screen hopping is successful.| CooperateState.COOPERATE_ACTIVATE_SUCCESS | 42| COOPERATE_ACTIVATE_FAIL | **CooperateState.COOPERATE_ACTIVATE_FAILURE** is used to indicate that starting screen hopping has failed.| CooperateState.COOPERATE_ACTIVATE_FAILURE | 43| COOPERATE_DEACTIVATE_SUCCESS | **CooperateState.COOPERATE_DEACTIVATE_SUCCESS** is used to indicate that stopping screen hopping is successful.| CooperateState.COOPERATE_DEACTIVATE_SUCCESS | 44| COOPERATE_DEACTIVATE_FAIL | **CooperateState.COOPERATE_DEACTIVATE_FAILURE** is used to indicate that stopping screen hopping has failed.| CooperateState.COOPERATE_DEACTIVATE_FAILURE | 45| COOPERATE_SESSION_DISCONNECTED | **CooperateState.COOPERATE_SESSION_DISCONNECTED** is used to indicate that the screen hopping session is disconnected.| CooperateState.COOPERATE_SESSION_DISCONNECTED | 46 47**Adaptation Guide** 48 49You are advised to use [@ohos.cooperate](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-devicestatus-cooperate.md#cooperateprepare). 50