1 /*
2  * Copyright (c) 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 #include <future>
17 #include <optional>
18 #include <vector>
19 
20 #include <unistd.h>
21 
22 #include <gtest/gtest.h>
23 #include "pointer_event.h"
24 #include "securec.h"
25 
26 #include "devicestatus_define.h"
27 #include "devicestatus_errors.h"
28 #include "interaction_manager.h"
29 
30 #undef LOG_TAG
31 #define LOG_TAG "InteractionDragDrawingTest"
32 
33 namespace OHOS {
34 namespace Msdp {
35 namespace DeviceStatus {
36 using namespace testing::ext;
37 namespace {
38 constexpr uint32_t DEFAULT_ICON_COLOR { 0xFF };
39 constexpr int32_t TIME_WAIT_FOR_OP_MS { 20 };
40 constexpr int32_t PIXEL_MAP_WIDTH { 300 };
41 constexpr int32_t PIXEL_MAP_HEIGHT { 300 };
42 constexpr int32_t MIDDLE_PIXEL_MAP_WIDTH { 400 };
43 constexpr int32_t MIDDLE_PIXEL_MAP_HEIGHT { 400 };
44 constexpr int32_t MAX_PIXEL_MAP_WIDTH { 600 };
45 constexpr int32_t MAX_PIXEL_MAP_HEIGHT { 600 };
46 constexpr int32_t POINTER_ID { 0 };
47 constexpr int32_t DISPLAY_ID { 0 };
48 constexpr int32_t DISPLAY_X { 50 };
49 constexpr int32_t DISPLAY_Y { 50 };
50 constexpr int32_t DRAG_NUM_ONE { 1 };
51 constexpr int32_t SHADOW_NUM_ONE { 1 };
52 constexpr int32_t SHADOW_NUM_MULTIPLE { 3 };
53 constexpr int32_t SHADOW_NUM_TOO_MUCH { 5 };
54 constexpr int32_t DRAG_NUM_MULTIPLE { 10 };
55 constexpr int32_t INT32_BYTE { 4 };
56 constexpr int32_t PROMISE_WAIT_SPAN_MS { 2000 };
57 constexpr int32_t TIME_WAIT_FOR_UPDATE_DRAG_STYLE { 50 };
58 constexpr int32_t TIME_WAIT_FOR_ANIMATION_END { 1000 };
59 constexpr int32_t WINDOW_ID { -1 };
60 constexpr bool HAS_CANCELED_ANIMATION { true };
61 constexpr bool HAS_CUSTOM_ANIMATION { true };
62 constexpr bool DRAG_WINDOW_VISIBLE { true };
63 const std::string UD_KEY { "Unified data key" };
64 const std::string FILTER_INFO { "Undefined filter info" };
65 const std::string EXTRA_INFO { "Undefined extra info" };
66 } // namespace
67 
68 class InteractionDragDrawingTest : public testing::Test {
69 public:
70     void SetUp();
71     void TearDown();
72     static void SetUpTestCase();
73     static std::shared_ptr<Media::PixelMap> CreatePixelMap(int32_t width, int32_t height);
74     static std::optional<DragData> CreateDragData(int32_t sourceType, int32_t pointerId, int32_t dragNum,
75         bool hasCoordinateCorrected, int32_t shadowNum);
76 };
77 
SetUpTestCase()78 void InteractionDragDrawingTest::SetUpTestCase() {}
79 
SetUp()80 void InteractionDragDrawingTest::SetUp() {}
81 
TearDown()82 void InteractionDragDrawingTest::TearDown()
83 {
84     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_OP_MS));
85 }
86 
CreatePixelMap(int32_t width,int32_t height)87 std::shared_ptr<Media::PixelMap> InteractionDragDrawingTest::CreatePixelMap(int32_t width, int32_t height)
88 {
89     CALL_DEBUG_ENTER;
90     if (width <= 0 || width > MAX_PIXEL_MAP_WIDTH || height <= 0 || height > MAX_PIXEL_MAP_HEIGHT) {
91         FI_HILOGE("Size invalid, height:%{public}d, width:%{public}d", height, width);
92         return nullptr;
93     }
94     Media::InitializationOptions opts;
95     opts.size.height = height;
96     opts.size.width = width;
97     opts.pixelFormat = Media::PixelFormat::BGRA_8888;
98     opts.alphaType = Media::AlphaType::IMAGE_ALPHA_TYPE_OPAQUE;
99     opts.scaleMode = Media::ScaleMode::FIT_TARGET_SIZE;
100 
101     int32_t colorLen = width * height;
102     uint32_t *pixelColors = new (std::nothrow) uint32_t[colorLen];
103     CHKPP(pixelColors);
104     int32_t colorByteCount = colorLen * INT32_BYTE;
105     errno_t ret = memset_s(pixelColors, colorByteCount, DEFAULT_ICON_COLOR, colorByteCount);
106     if (ret != EOK) {
107         FI_HILOGE("memset_s failed");
108         delete[] pixelColors;
109         return nullptr;
110     }
111     std::shared_ptr<Media::PixelMap> pixelMap = Media::PixelMap::Create(pixelColors, colorLen, opts);
112     if (pixelMap == nullptr) {
113         FI_HILOGE("Create pixelMap failed");
114         delete[] pixelColors;
115         return nullptr;
116     }
117     delete[] pixelColors;
118     return pixelMap;
119 }
120 
121 class TestStartDragListener : public IStartDragListener {
122 public:
TestStartDragListener(std::function<void (const DragNotifyMsg &)> function)123     explicit TestStartDragListener(std::function<void(const DragNotifyMsg&)> function) : function_(function) { }
OnDragEndMessage(const DragNotifyMsg & msg)124     void OnDragEndMessage(const DragNotifyMsg &msg) override
125     {
126         FI_HILOGD("DisplayX:%{public}d, displayY:%{public}d, targetPid:%{public}d, result:%{public}d",
127             msg.displayX, msg.displayY, msg.targetPid, static_cast<int32_t>(msg.result));
128         if (function_ != nullptr) {
129             function_(msg);
130         }
131         FI_HILOGD("Test OnDragEndMessage");
132     }
133 
OnHideIconMessage()134     void OnHideIconMessage() override
135     {
136         FI_HILOGD("Test OnHideIconMessage");
137     }
138 private:
139     std::function<void(const DragNotifyMsg&)> function_;
140 };
141 
CreateDragData(int32_t sourceType,int32_t pointerId,int32_t dragNum,bool hasCoordinateCorrected,int32_t shadowNum)142 std::optional<DragData> InteractionDragDrawingTest::CreateDragData(int32_t sourceType,
143     int32_t pointerId, int32_t dragNum, bool hasCoordinateCorrected, int32_t shadowNum)
144 {
145     CALL_DEBUG_ENTER;
146     DragData dragData;
147     for (int32_t i = 0; i < shadowNum; i++) {
148         std::shared_ptr<Media::PixelMap> pixelMap = CreatePixelMap(PIXEL_MAP_WIDTH, PIXEL_MAP_HEIGHT);
149         if (pixelMap == nullptr) {
150             FI_HILOGE("CreatePixelMap failed");
151             return std::nullopt;
152         }
153         dragData.shadowInfos.push_back({ pixelMap, 0, 0 });
154     }
155     dragData.buffer = std::vector<uint8_t>(MAX_BUFFER_SIZE, 0);
156     dragData.udKey = UD_KEY;
157     dragData.extraInfo = FILTER_INFO;
158     dragData.extraInfo = EXTRA_INFO;
159     dragData.sourceType = sourceType;
160     dragData.pointerId = pointerId;
161     dragData.dragNum = dragNum;
162     dragData.displayX = DISPLAY_X;
163     dragData.displayY = DISPLAY_Y;
164     dragData.displayId = DISPLAY_ID;
165     dragData.hasCanceledAnimation = HAS_CANCELED_ANIMATION;
166     dragData.hasCoordinateCorrected = hasCoordinateCorrected;
167     return dragData;
168 }
169 
170 /**
171  * @tc.name: InteractionDragDrawingTest_Mouse_DragNum_One
172  * @tc.desc: Drag Drawing
173  * @tc.type: FUNC
174  * @tc.require:
175  */
176 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Mouse_DragNum_One, TestSize.Level1)
177 {
178     CALL_TEST_DEBUG;
179     std::optional<DragData> dragData = CreateDragData(
180         MMI::PointerEvent::SOURCE_TYPE_MOUSE, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
181     ASSERT_TRUE(dragData);
182     std::promise<bool> promiseFlag;
183     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0202(const DragNotifyMsg &notifyMessage) 184     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
185         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
186             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
187         promiseFlag.set_value(true);
188     };
189     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
190         std::make_shared<TestStartDragListener>(callback));
191     ASSERT_EQ(ret, RET_OK);
192     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
193     ASSERT_EQ(ret, RET_OK);
194     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::DEFAULT);
195     ASSERT_EQ(ret, RET_OK);
196     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
197     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
198     ASSERT_EQ(ret, RET_OK);
199     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
200     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::FORBIDDEN);
201     ASSERT_EQ(ret, RET_OK);
202     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
203     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::MOVE);
204     ASSERT_EQ(ret, RET_OK);
205     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
206     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::DEFAULT);
207     ASSERT_EQ(ret, RET_OK);
208     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
209     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
210     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
211     ASSERT_EQ(ret, RET_OK);
212     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
213 }
214 
215 /**
216  * @tc.name: InteractionDragDrawingTest_Mouse_DragNum_Multiple
217  * @tc.desc: Drag Drawing
218  * @tc.type: FUNC
219  * @tc.require:
220  */
221 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Mouse_DragNum_Multiple, TestSize.Level1)
222 {
223     CALL_TEST_DEBUG;
224     std::promise<bool> promiseFlag;
225     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0302(const DragNotifyMsg &notifyMessage) 226     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
227         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
228             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
229         promiseFlag.set_value(true);
230     };
231     std::optional<DragData> dragData = CreateDragData(
232         MMI::PointerEvent::SOURCE_TYPE_MOUSE, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
233     ASSERT_TRUE(dragData);
234     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
235         std::make_shared<TestStartDragListener>(callback));
236     ASSERT_EQ(ret, RET_OK);
237     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
238     ASSERT_EQ(ret, RET_OK);
239     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
240     ASSERT_EQ(ret, RET_OK);
241     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
242     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::FORBIDDEN);
243     ASSERT_EQ(ret, RET_OK);
244     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
245     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::MOVE);
246     ASSERT_EQ(ret, RET_OK);
247     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
248     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::DEFAULT);
249     ASSERT_EQ(ret, RET_OK);
250     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
251     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::MOVE);
252     ASSERT_EQ(ret, RET_OK);
253     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
254     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
255     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
256     ASSERT_EQ(ret, RET_OK);
257     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
258 }
259 
260 /**
261  * @tc.name: InteractionDragDrawingTest_Touchscreen_DragNum_One
262  * @tc.desc: Drag Drawing
263  * @tc.type: FUNC
264  * @tc.require:
265  */
266 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Touchscreen_DragNum_One, TestSize.Level1)
267 {
268     CALL_TEST_DEBUG;
269     std::promise<bool> promiseFlag;
270     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0402(const DragNotifyMsg &notifyMessage) 271     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
272         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, target:%{public}d, result:%{public}d",
273             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.targetPid, notifyMessage.result);
274         promiseFlag.set_value(true);
275     };
276     std::optional<DragData> dragData = CreateDragData(
277         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
278     ASSERT_TRUE(dragData);
279     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
280         std::make_shared<TestStartDragListener>(callback));
281     ASSERT_EQ(ret, RET_OK);
282     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
283     ASSERT_EQ(ret, RET_OK);
284     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
285     ASSERT_EQ(ret, RET_OK);
286     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
287     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::DEFAULT);
288     ASSERT_EQ(ret, RET_OK);
289     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
290     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::MOVE);
291     ASSERT_EQ(ret, RET_OK);
292     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
293     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::FORBIDDEN);
294     ASSERT_EQ(ret, RET_OK);
295     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
296     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
297     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
298     ASSERT_EQ(ret, RET_OK);
299     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
300 }
301 
302 /**
303  * @tc.name: InteractionDragDrawingTest_Touchscreen_DragNum_Multiple
304  * @tc.desc: Drag Drawing
305  * @tc.type: FUNC
306  * @tc.require:
307  */
308 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Touchscreen_DragNum_Multiple, TestSize.Level1)
309 {
310     CALL_TEST_DEBUG;
311     std::optional<DragData> dragData = CreateDragData(
312         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
313     ASSERT_TRUE(dragData);
314     std::promise<bool> promiseFlag;
315     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0502(const DragNotifyMsg &notifyMessage) 316     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
317         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
318             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
319         promiseFlag.set_value(true);
320     };
321     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
322         std::make_shared<TestStartDragListener>(callback));
323     ASSERT_EQ(ret, RET_OK);
324     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
325     ASSERT_EQ(ret, RET_OK);
326     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
327     ASSERT_EQ(ret, RET_OK);
328     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
329     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::DEFAULT);
330     ASSERT_EQ(ret, RET_OK);
331     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
332     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::FORBIDDEN);
333     ASSERT_EQ(ret, RET_OK);
334     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
335     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::MOVE);
336     ASSERT_EQ(ret, RET_OK);
337     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
338     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
339     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
340     ASSERT_EQ(ret, RET_OK);
341     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
342 }
343 
344 /**
345  * @tc.name: InteractionDragDrawingTest_UpdateShadowPic
346  * @tc.desc: Drag Drawing
347  * @tc.type: FUNC
348  * @tc.require:
349  */
350 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_UpdateShadowPic, TestSize.Level1)
351 {
352     CALL_TEST_DEBUG;
353     std::promise<bool> promiseFlag;
354     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0602(const DragNotifyMsg &notifyMessage) 355     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
356         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
357             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
358         promiseFlag.set_value(true);
359     };
360     std::optional<DragData> dragData = CreateDragData(
361         MMI::PointerEvent::SOURCE_TYPE_MOUSE, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
362     ASSERT_TRUE(dragData);
363     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
364         std::make_shared<TestStartDragListener>(callback));
365     ASSERT_EQ(ret, RET_OK);
366     std::shared_ptr<Media::PixelMap> pixelMap = CreatePixelMap(MIDDLE_PIXEL_MAP_WIDTH, MIDDLE_PIXEL_MAP_HEIGHT);
367     ASSERT_NE(pixelMap, nullptr);
368     ShadowInfo shadowInfo = { pixelMap, 0, 0 };
369     ret = InteractionManager::GetInstance()->UpdateShadowPic(shadowInfo);
370     ASSERT_EQ(ret, RET_OK);
371     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
372     ASSERT_EQ(ret, RET_OK);
373     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
374     ASSERT_EQ(ret, RET_OK);
375     DragDropResult dropResult { DragResult::DRAG_FAIL, HAS_CUSTOM_ANIMATION, WINDOW_ID };
376     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
377     ASSERT_EQ(ret, RET_OK);
378     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
379     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_ANIMATION_END));
380 }
381 
382 /**
383  * @tc.name: InteractionDragDrawingTest_Mouse_Animation
384  * @tc.desc: Drag Drawing
385  * @tc.type: FUNC
386  * @tc.require:
387  */
388 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Mouse_Animation, TestSize.Level1)
389 {
390     CALL_TEST_DEBUG;
391     std::promise<bool> promiseFlag;
392     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0702(const DragNotifyMsg &notifyMessage) 393     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
394         FI_HILOGD("result:%{public}d, target:%{public}d, displayX:%{public}d, displayY:%{public}d",
395             notifyMessage.result, notifyMessage.targetPid, notifyMessage.displayX, notifyMessage.displayY);
396         promiseFlag.set_value(true);
397     };
398     std::optional<DragData> dragData = CreateDragData(
399         MMI::PointerEvent::SOURCE_TYPE_MOUSE, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
400     ASSERT_TRUE(dragData);
401     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
402         std::make_shared<TestStartDragListener>(callback));
403     ASSERT_EQ(ret, RET_OK);
404     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
405     ASSERT_EQ(ret, RET_OK);
406     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
407     ASSERT_EQ(ret, RET_OK);
408     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
409     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
410     ASSERT_EQ(ret, RET_OK);
411     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
412     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_ANIMATION_END));
413 }
414 
415 /**
416  * @tc.name: InteractionDragDrawingTest_Touchscreen_Animation
417  * @tc.desc: Drag Drawing
418  * @tc.type: FUNC
419  * @tc.require:
420  */
421 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Touchscreen_Animation, TestSize.Level1)
422 {
423     CALL_TEST_DEBUG;
424     std::promise<bool> promiseFlag;
425     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0802(const DragNotifyMsg &notifyMessage) 426     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
427         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, target:%{public}d, result:%{public}d",
428             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.targetPid, notifyMessage.result);
429         promiseFlag.set_value(true);
430     };
431     std::optional<DragData> dragData = CreateDragData(
432         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
433     ASSERT_TRUE(dragData);
434     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
435         std::make_shared<TestStartDragListener>(callback));
436     ASSERT_EQ(ret, RET_OK);
437     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
438     ASSERT_EQ(ret, RET_OK);
439     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
440     ASSERT_EQ(ret, RET_OK);
441     DragDropResult dropResult { DragResult::DRAG_FAIL, HAS_CUSTOM_ANIMATION, WINDOW_ID };
442     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
443     ASSERT_EQ(ret, RET_OK);
444     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
445 }
446 
447 /**
448  * @tc.name: InteractionDragDrawingTest_Multiple_Shadow
449  * @tc.desc: Drag Drawing
450  * @tc.type: FUNC
451  * @tc.require:
452  */
453 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_ONE_Shadow, TestSize.Level1)
454 {
455     CALL_TEST_DEBUG;
456     std::promise<bool> promiseFlag;
457     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0902(const DragNotifyMsg &notifyMessage) 458     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
459         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
460             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
461         promiseFlag.set_value(true);
462     };
463     std::optional<DragData> dragData = CreateDragData(
464         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
465     ASSERT_TRUE(dragData);
466     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
467         std::make_shared<TestStartDragListener>(callback));
468     ASSERT_EQ(ret, RET_OK);
469     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
470     ASSERT_EQ(ret, RET_OK);
471     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
472     ASSERT_EQ(ret, RET_OK);
473     DragDropResult dropResult { DragResult::DRAG_FAIL, HAS_CUSTOM_ANIMATION, WINDOW_ID };
474     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
475     ASSERT_EQ(ret, RET_OK);
476     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
477 }
478 
479 /**
480  * @tc.name: InteractionDragDrawingTest_Multiple_Shadow
481  * @tc.desc: Drag Drawing
482  * @tc.type: FUNC
483  * @tc.require:
484  */
485 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Multiple_Shadow, TestSize.Level1)
486 {
487     CALL_TEST_DEBUG;
488     std::promise<bool> promiseFlag;
489     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0a02(const DragNotifyMsg &notifyMessage) 490     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
491         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
492             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
493         promiseFlag.set_value(true);
494     };
495     std::optional<DragData> dragData = CreateDragData(
496         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_MULTIPLE);
497     ASSERT_TRUE(dragData);
498     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
499         std::make_shared<TestStartDragListener>(callback));
500     ASSERT_EQ(ret, RET_OK);
501     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
502     ASSERT_EQ(ret, RET_OK);
503     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
504     ASSERT_EQ(ret, RET_OK);
505     DragDropResult dropResult { DragResult::DRAG_FAIL, HAS_CUSTOM_ANIMATION, WINDOW_ID };
506     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
507     ASSERT_EQ(ret, RET_OK);
508     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
509 }
510 
511 /**
512  * @tc.name: InteractionDragDrawingTest_Multiple_Shadow
513  * @tc.desc: Drag Drawing
514  * @tc.type: FUNC
515  * @tc.require:
516  */
517 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_Too_Much_Shadow, TestSize.Level1)
518 {
519     CALL_TEST_DEBUG;
520     std::promise<bool> promiseFlag;
521     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0b02(const DragNotifyMsg &notifyMessage) 522     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
523         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
524             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
525         promiseFlag.set_value(true);
526     };
527     std::optional<DragData> dragData = CreateDragData(
528         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_TOO_MUCH);
529     ASSERT_TRUE(dragData);
530     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
531         std::make_shared<TestStartDragListener>(callback));
532     ASSERT_EQ(ret, RET_OK);
533     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
534     ASSERT_EQ(ret, RET_OK);
535     ret = InteractionManager::GetInstance()->UpdateDragStyle(DragCursorStyle::COPY);
536     ASSERT_EQ(ret, RET_OK);
537     DragDropResult dropResult { DragResult::DRAG_FAIL, HAS_CUSTOM_ANIMATION, WINDOW_ID };
538     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
539     ASSERT_EQ(ret, RET_OK);
540     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
541 }
542 
543 /**
544  * @tc.name: EnterTextEditorArea001
545  * @tc.desc: normal test for pixelMap 8dp bit movement effect
546  * @tc.type: FUNC
547  * @tc.require:
548  */
549 HWTEST_F(InteractionDragDrawingTest, EnterTextEditorArea001, TestSize.Level1)
550 {
551     CALL_TEST_DEBUG;
552     std::promise<bool> promiseFlag;
553     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0c02(const DragNotifyMsg &notifyMessage) 554     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
555         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
556             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
557         promiseFlag.set_value(true);
558     };
559     std::optional<DragData> dragData = CreateDragData(
560         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
561     ASSERT_TRUE(dragData);
562     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
563         std::make_shared<TestStartDragListener>(callback));
564     ASSERT_EQ(ret, RET_OK);
565     ret = InteractionManager::GetInstance()->EnterTextEditorArea(true);
566     EXPECT_EQ(ret, RET_OK);
567     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_ANIMATION_END));
568     ret = InteractionManager::GetInstance()->EnterTextEditorArea(false);
569     EXPECT_EQ(ret, RET_OK);
570     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
571     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
572     ASSERT_EQ(ret, RET_OK);
573     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
574 }
575 
576 /**
577  * @tc.name: EnterTextEditorArea002
578  * @tc.desc: abnormal test for pixelMap 8dp bit movement effect
579  * @tc.type: FUNC
580  * @tc.require:
581  */
582 HWTEST_F(InteractionDragDrawingTest, EnterTextEditorArea002, TestSize.Level1)
583 {
584     CALL_TEST_DEBUG;
585     std::promise<bool> promiseFlag;
586     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0d02(const DragNotifyMsg &notifyMessage) 587     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
588         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d, target:%{public}d",
589             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result, notifyMessage.targetPid);
590         promiseFlag.set_value(true);
591     };
592     std::optional<DragData> dragData = CreateDragData(
593         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, false, SHADOW_NUM_ONE);
594     ASSERT_TRUE(dragData);
595     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
596         std::make_shared<TestStartDragListener>(callback));
597     ASSERT_EQ(ret, RET_OK);
598     ret = InteractionManager::GetInstance()->EnterTextEditorArea(false);
599     EXPECT_EQ(ret, RET_ERR);
600     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
601     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
602     ASSERT_EQ(ret, RET_OK);
603     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
604 }
605 
606 /**
607  * @tc.name: EnterTextEditorArea003
608  * @tc.desc: abnormal test for pixelMap 8dp bit movement effect
609  * @tc.type: FUNC
610  * @tc.require:
611  */
612 HWTEST_F(InteractionDragDrawingTest, EnterTextEditorArea003, TestSize.Level1)
613 {
614     CALL_TEST_DEBUG;
615     std::optional<DragData> dragData = CreateDragData(
616         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_ONE, true, SHADOW_NUM_ONE);
617     ASSERT_TRUE(dragData);
618     int32_t ret = InteractionManager::GetInstance()->EnterTextEditorArea(true);
619     EXPECT_EQ(ret, RET_ERR);
620 }
621 
622 /**
623  * @tc.name: InteractionDragDrawingTest_DragOpacity001
624  * @tc.desc: Abnormal transparency test for drag and drop backboard
625  * @tc.type: FUNC
626  * @tc.require:
627  */
628 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_DragOpacity001, TestSize.Level1)
629 {
630     CALL_TEST_DEBUG;
631     std::optional<DragData> dragData = CreateDragData(
632         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
633     ASSERT_TRUE(dragData);
634     dragData->filterInfo = " { \"dip_opacity\": nullptr } ";
635     std::promise<bool> promiseFlag;
636     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0e02(const DragNotifyMsg &notifyMessage) 637     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
638         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
639             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
640         promiseFlag.set_value(true);
641     };
642     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
643         std::make_shared<TestStartDragListener>(callback));
644     ASSERT_EQ(ret, RET_OK);
645     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
646     ASSERT_EQ(ret, RET_OK);
647     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
648     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
649     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
650     ASSERT_EQ(ret, RET_OK);
651     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
652 }
653 
654 /**
655  * @tc.name: InteractionDragDrawingTest_DragOpacity002
656  * @tc.desc: Abnormal transparency test for drag and drop backboard
657  * @tc.type: FUNC
658  * @tc.require:
659  */
660 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_DragOpacity002, TestSize.Level1)
661 {
662     CALL_TEST_DEBUG;
663     std::optional<DragData> dragData = CreateDragData(
664         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
665     ASSERT_TRUE(dragData);
666     dragData->filterInfo = " { \"dip_opacity\": 3.0 } ";
667     std::promise<bool> promiseFlag;
668     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d0f02(const DragNotifyMsg &notifyMessage) 669     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
670         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
671             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
672         promiseFlag.set_value(true);
673     };
674     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
675         std::make_shared<TestStartDragListener>(callback));
676     ASSERT_EQ(ret, RET_OK);
677     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
678     ASSERT_EQ(ret, RET_OK);
679     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
680     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
681     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
682     ASSERT_EQ(ret, RET_OK);
683     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
684 }
685 
686 /**
687  * @tc.name: InteractionDragDrawingTest_DragOpacity003
688  * @tc.desc: Normal transparency test for drag and drop backboard
689  * @tc.type: FUNC
690  * @tc.require:
691  */
692 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_DragOpacity003, TestSize.Level1)
693 {
694     CALL_TEST_DEBUG;
695     std::optional<DragData> dragData = CreateDragData(
696         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
697     ASSERT_TRUE(dragData);
698     dragData->filterInfo = " { \"dip_opacity\": 0.60 } ";
699     std::promise<bool> promiseFlag;
700     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d1002(const DragNotifyMsg &notifyMessage) 701     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
702         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
703             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
704         promiseFlag.set_value(true);
705     };
706     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
707         std::make_shared<TestStartDragListener>(callback));
708     ASSERT_EQ(ret, RET_OK);
709     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
710     ASSERT_EQ(ret, RET_OK);
711     std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_UPDATE_DRAG_STYLE));
712     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
713     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
714     ASSERT_EQ(ret, RET_OK);
715     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
716 }
717 
718 /**
719  * @tc.name: InteractionDragDrawingTest_RotateDragWindowSync
720  * @tc.desc: Rotate and drag the window to Synchronize
721  * @tc.type: FUNC
722  * @tc.require:
723  */
724 HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_RotateDragWindowSync, TestSize.Level1)
725 {
726     CALL_TEST_DEBUG;
727     std::optional<DragData> dragData = CreateDragData(
728         MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
729     ASSERT_TRUE(dragData);
730     std::promise<bool> promiseFlag;
731     std::future<bool> futureFlag = promiseFlag.get_future();
__anone809606d1102(const DragNotifyMsg &notifyMessage) 732     auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
733         FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
734             notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
735         promiseFlag.set_value(true);
736     };
737     int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
738         std::make_shared<TestStartDragListener>(callback));
739     ASSERT_EQ(ret, RET_OK);
740     ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
741     ASSERT_EQ(ret, RET_OK);
742     const std::shared_ptr<Rosen::RSTransaction>& rsTransaction { nullptr };
743     InteractionManager::GetInstance()->RotateDragWindowSync(rsTransaction);
744     DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
745     ret = InteractionManager::GetInstance()->StopDrag(dropResult);
746     ASSERT_EQ(ret, RET_OK);
747     ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
748 }
749 } // namespace DeviceStatus
750 } // namespace Msdp
751 } // namespace OHOS
752