mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-23 23:30:28 +00:00
parent
5d4655def1
commit
6fd7ccbf31
@ -803,7 +803,7 @@ ErrCode FormMgrAdapter::AddExistFormRecord(const FormItemInfo &info, const sptr<
|
||||
|
||||
// Add new form user uid.
|
||||
FormDataMgr::GetInstance().AddFormUserUid(formId, callingUid);
|
||||
if(std::find(newRecord.formUserUids.begin(), newRecord.formUserUids.end(), callingUid) ==
|
||||
if (std::find(newRecord.formUserUids.begin(), newRecord.formUserUids.end(), callingUid) ==
|
||||
newRecord.formUserUids.end()) {
|
||||
newRecord.formUserUids.emplace_back(callingUid);
|
||||
}
|
||||
|
@ -26,14 +26,14 @@ namespace AppExecFwk {
|
||||
* @param formId The id of the form.
|
||||
* @return Returns true on success, false on failure.
|
||||
*/
|
||||
bool FormRefreshLimiter::AddItem(const int64_t formId)
|
||||
bool FormRefreshLimiter::AddItem(const int64_t formId)
|
||||
{
|
||||
APP_LOGI("%{public}s start", __func__);
|
||||
std::lock_guard<std::mutex> lock(limiterMutex_);
|
||||
auto info = limiterMap_.find(formId);
|
||||
if (info == limiterMap_.end()) {
|
||||
LimitInfo limitInfo;
|
||||
std::pair<std::map<int64_t, LimitInfo>::iterator, bool> retVal =
|
||||
std::pair<std::map<int64_t, LimitInfo>::iterator, bool> retVal =
|
||||
limiterMap_.emplace(formId, limitInfo);
|
||||
APP_LOGI("%{public}s end", __func__);
|
||||
return retVal.second;
|
||||
@ -46,7 +46,7 @@ bool FormRefreshLimiter::AddItem(const int64_t formId)
|
||||
* @brief Delete form limit info by formId.
|
||||
* @param formId The form id.
|
||||
*/
|
||||
void FormRefreshLimiter::DeleteItem(const int64_t formId)
|
||||
void FormRefreshLimiter::DeleteItem(const int64_t formId)
|
||||
{
|
||||
APP_LOGI("%{public}s start", __func__);
|
||||
std::lock_guard<std::mutex> lock(limiterMutex_);
|
||||
@ -121,7 +121,7 @@ void FormRefreshLimiter::Increase(const int64_t formId)
|
||||
APP_LOGI("%{public}s start", __func__);
|
||||
std::lock_guard<std::mutex> lock(limiterMutex_);
|
||||
auto info = limiterMap_.find(formId);
|
||||
if (info != limiterMap_.end()) {
|
||||
if (info != limiterMap_.end()) {
|
||||
info->second.refreshCount++;
|
||||
APP_LOGI("increase,formId:%{public}" PRId64 ", count:%{public}d", formId, info->second.refreshCount);
|
||||
if (info->second.refreshCount == Constants::LIMIT_COUNT && !info->second.isReported) {
|
||||
@ -140,7 +140,7 @@ void FormRefreshLimiter::MarkRemind(const int64_t formId)
|
||||
APP_LOGI("%{public}s start", __func__);
|
||||
std::lock_guard<std::mutex> lock(limiterMutex_);
|
||||
auto info = limiterMap_.find(formId);
|
||||
if (info != limiterMap_.end()) {
|
||||
if (info != limiterMap_.end()) {
|
||||
if (info->second.refreshCount >= Constants::LIMIT_COUNT) {
|
||||
info->second.remindFlag = true;
|
||||
}
|
||||
|
@ -665,9 +665,9 @@ bool FormTimerMgr::GetUpdateAtTimer(const int64_t formId, UpdateAtItem &updateAt
|
||||
bool FormTimerMgr::GetDynamicItem(const int64_t formId, DynamicRefreshItem &dynamicItem)
|
||||
{
|
||||
APP_LOGI("%{public}s start", __func__);
|
||||
std::lock_guard<std::mutex> lock(dynamicMutex_);
|
||||
std::lock_guard<std::mutex> lock(dynamicMutex_);
|
||||
std::vector<DynamicRefreshItem>::iterator itItem;
|
||||
for (itItem = dynamicRefreshTasks_.begin(); itItem != dynamicRefreshTasks_.end();) {
|
||||
for (itItem = dynamicRefreshTasks_.begin(); itItem != dynamicRefreshTasks_.end(); ) {
|
||||
if (itItem->formId == formId) {
|
||||
dynamicItem.formId = itItem->formId;
|
||||
dynamicItem.settedTime = itItem->settedTime;
|
||||
|
@ -13,9 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "system_test_form_util.h"
|
||||
#include "install_tool_status_receiver.h"
|
||||
#include "iservice_registry.h"
|
||||
#include "status_receiver_host.h"
|
||||
#include "install_tool_status_receiver.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace STtools {
|
||||
|
@ -704,7 +704,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2)
|
||||
SystemTestFormUtil::StartAbility(want, abilityManager);
|
||||
EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0);
|
||||
int tmp = 5;
|
||||
std::string eventData = ((i/tmp == 1) ? "true" : "false");
|
||||
std::string eventData = ((i / tmp == 1) ? "true" : "false");
|
||||
SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1200, EVENT_CODE_1200, eventData);
|
||||
EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200));
|
||||
formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200);
|
||||
@ -894,7 +894,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_A()
|
||||
SystemTestFormUtil::StartAbility(want, abilityManager);
|
||||
EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0);
|
||||
int tmp = 5;
|
||||
std::string eventData = ((i/tmp == 1) ? "true" : "false");
|
||||
std::string eventData = ((i / tmp == 1) ? "true" : "false");
|
||||
SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_1400, eventData);
|
||||
EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100));
|
||||
formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100);
|
||||
@ -936,7 +936,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_B()
|
||||
SystemTestFormUtil::StartAbility(want, abilityManager);
|
||||
EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0);
|
||||
int tmp = 5;
|
||||
std::string eventData = ((i/tmp == 1) ? "true" : "false");
|
||||
std::string eventData = ((i / tmp == 1) ? "true" : "false");
|
||||
SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1400, EVENT_CODE_1400, eventData);
|
||||
EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400));
|
||||
formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400);
|
||||
|
Loading…
Reference in New Issue
Block a user