mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-20 20:20:13 -04:00
!1231 为手势动画ipc通信增加vector校验
Merge pull request !1231 from chenhaiying/m4
This commit is contained in:
@@ -590,22 +590,12 @@ void WindowManagerProxy::MinimizeWindowsByLauncher(std::vector<uint32_t> windowI
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return;
|
||||
}
|
||||
auto size = static_cast<uint32_t>(windowIds.size());
|
||||
const uint32_t maxWindowNum = 100;
|
||||
if (size > maxWindowNum) {
|
||||
WLOGFE("windowNum cannot exceeds than 100");
|
||||
|
||||
if (!data.WriteUInt32Vector(windowIds)) {
|
||||
WLOGFE("Write windowIds failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteUint32(size)) {
|
||||
WLOGFE("Write windowNum failed");
|
||||
return;
|
||||
}
|
||||
for (auto id : windowIds) {
|
||||
if (!data.WriteUint32(id)) {
|
||||
WLOGFE("Write windowId failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.WriteBool(isAnimated)) {
|
||||
WLOGFE("Write isAnimated failed");
|
||||
return;
|
||||
|
||||
@@ -201,10 +201,7 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_GET_ANIMATION_CALLBACK: {
|
||||
std::vector<uint32_t> windowIds;
|
||||
uint32_t windowNum = data.ReadUint32();
|
||||
for (uint32_t i = 0; i < windowNum; ++i) {
|
||||
windowIds.push_back(data.ReadUint32());
|
||||
}
|
||||
data.ReadUInt32Vector(&windowIds);
|
||||
bool isAnimated = data.ReadBool();
|
||||
sptr<RSIWindowAnimationFinishedCallback> finishedCallback = nullptr;
|
||||
MinimizeWindowsByLauncher(windowIds, isAnimated, finishedCallback);
|
||||
|
||||
Reference in New Issue
Block a user