chore.增加了一个分辨率获取错误的报错

This commit is contained in:
MistEO
2022-06-06 01:02:35 +08:00
parent f52d6a7043
commit 6816b4d3c5
3 changed files with 17 additions and 11 deletions

View File

@@ -974,7 +974,13 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a
m_callback(AsstMsg::ConnectionInfo, info, m_callback_arg);
if (m_width < WindowWidthDefault || m_height < WindowHeightDefault) {
if (m_width == 0 || m_height == 0) {
info["what"] = "ResolutionError";
info["why"] = "Get resolution failed";
m_callback(AsstMsg::ConnectionInfo, info, m_callback_arg);
return false;
}
else if (m_width < WindowWidthDefault || m_height < WindowHeightDefault) {
info["what"] = "UnsupportedResolution";
info["why"] = "Low screen resolution";
m_callback(AsstMsg::ConnectionInfo, info, m_callback_arg);
@@ -1062,7 +1068,7 @@ bool asst::Controller::release()
{
return call_command(m_adb.release).has_value();
}
}
}
const std::string& asst::Controller::get_uuid() const
{