mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
fix autofill unfocus problems
Signed-off-by: xinking129 <xinxin13@huawei.com>
This commit is contained in:
@@ -69,8 +69,11 @@ private:
|
||||
AbilityBase::ViewData viewData_;
|
||||
bool isReloadInModal_ = false;
|
||||
bool isSmartAutoFill_ = false;
|
||||
bool isOnResult_ = false;
|
||||
AAFwk::Want want_;
|
||||
int32_t errCode_ = 0;
|
||||
AbilityBase::AutoFillType autoFillType_ = AbilityBase::AutoFillType::UNSPECIFIED;
|
||||
};
|
||||
} // AbilityRuntime
|
||||
} // OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_AUTO_FILL_EXTENSION_CALLBACK_H
|
||||
#endif // OHOS_ABILITY_RUNTIME_AUTO_FILL_EXTENSION_CALLBACK_H
|
||||
|
||||
@@ -33,14 +33,10 @@ void AutoFillExtensionCallback::OnResult(int32_t errCode, const AAFwk::Want &wan
|
||||
TAG_LOGD(AAFwkTag::AUTOFILLMGR, "Called, result code is %{public}d.", errCode);
|
||||
AutoFillManager::GetInstance().RemoveEvent(eventId_);
|
||||
CloseModalUIExtension();
|
||||
|
||||
if (errCode == AutoFill::AUTO_FILL_SUCCESS) {
|
||||
SendAutoFillSucess(want);
|
||||
} else {
|
||||
auto resultCode = (errCode == AutoFill::AUTO_FILL_CANCEL) ?
|
||||
AutoFill::AUTO_FILL_CANCEL : AutoFill::AUTO_FILL_FAILED;
|
||||
SendAutoFillFailed(resultCode);
|
||||
}
|
||||
|
||||
isOnResult_ = true;
|
||||
want_ = want;
|
||||
errCode_ = errCode;
|
||||
}
|
||||
|
||||
void AutoFillExtensionCallback::OnRelease(int32_t errCode)
|
||||
@@ -128,6 +124,17 @@ void AutoFillExtensionCallback::onDestroy()
|
||||
isReloadInModal_ = false;
|
||||
return;
|
||||
}
|
||||
if (isOnResult_) {
|
||||
isOnResult_ = false;
|
||||
if (errCode_ == AutoFill::AUTO_FILL_SUCCESS) {
|
||||
SendAutoFillSucess(want_);
|
||||
} else {
|
||||
auto resultCode = (errCode_ == AutoFill::AUTO_FILL_CANCEL) ?
|
||||
AutoFill::AUTO_FILL_CANCEL : AutoFill::AUTO_FILL_FAILED;
|
||||
SendAutoFillFailed(resultCode);
|
||||
}
|
||||
return;
|
||||
}
|
||||
SendAutoFillFailed(AutoFill::AUTO_FILL_CANCEL);
|
||||
CloseModalUIExtension();
|
||||
}
|
||||
@@ -233,4 +240,4 @@ void AutoFillExtensionCallback::CloseModalUIExtension()
|
||||
uiContent_ = nullptr;
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
} // namespace OHOS
|
||||
|
||||
Reference in New Issue
Block a user