内源检视

Signed-off-by: sqc <974827073@qq.com>
Change-Id: I08c72b0b6a97e2ea45ad4700a4201b2f5779e480
This commit is contained in:
sqc 2022-03-02 03:54:26 +00:00
parent 7ec7568072
commit fe6a5f84bf
22 changed files with 60 additions and 55 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -56,11 +56,11 @@ sptr<AAFwk::IAbilityScheduler> AAFwk::AbilityManagerClient::AcquireDataAbility(
retval = remoteProxy;
if (retval == nullptr) {
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock result retval is nullptr called";
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock result retval is nullptr called";
}
} else {
retval = iter->second;
GTEST_LOG_(INFO) << "mock_ability_manager_client:find data is not null called";
GTEST_LOG_(INFO) << "mock_ability_manager_client:find data is not null called";
}
return retval;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -35,17 +35,17 @@ sptr<AppExecFwk::AbilityThread> MockCreateAbilityThread()
{
sptr<AppExecFwk::AbilityThread> abilitythread(new (std::nothrow) AppExecFwk::AbilityThread());
if (abilitythread == nullptr) {
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock abilityhreadptr is nullptr called";
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock abilityhreadptr is nullptr called";
}
std::shared_ptr<OHOSApplication> application = std::make_shared<OHOSApplication>();
if (application == nullptr) {
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock applicationptr is nullptr called";
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock applicationptr is nullptr called";
}
std::shared_ptr<AbilityInfo> info = std::make_shared<AbilityInfo>();
if (info == nullptr) {
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock AbilityInfo::info is nullptr called";
GTEST_LOG_(INFO) << "mock_ability_thread_for_data_observer:mock AbilityInfo::info is nullptr called";
}
info->name = std::string("MockAbilityTest");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -13,13 +13,14 @@
* limitations under the License.
*/
#include "form_provider_data.h"
#include <cinttypes>
#include <fstream>
#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include "form_provider_data.h"
#include "hilog_wrapper.h"
#include "message_parcel.h"
#include "string_ex.h"

View File

@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "appexecfwk_errors.h"
#include "form_provider_proxy.h"
#include "appexecfwk_errors.h"
#include "string_ex.h"
namespace OHOS {

View File

@ -13,9 +13,9 @@
* limitations under the License.
*/
#include "form_supply_proxy.h"
#include "appexecfwk_errors.h"
#include "form_constants.h"
#include "form_supply_proxy.h"
#include "string_ex.h"
namespace OHOS {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -55,7 +55,7 @@ napi_value ParseBundleName(napi_env env, std::string &bundleName, napi_value arg
napi_get_value_string_utf8(env, args, buf, NapiAbilityMgr::BUFFER_LENGTH_MAX, &len);
HILOG_INFO("bundleName= [%{public}s].", buf);
bundleName = std::string(buf);
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -383,7 +383,7 @@ napi_value NAPI_QueryRecentAbilityMissionInfosWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 1, &ret));
return ret;
@ -520,7 +520,7 @@ napi_value NAPI_GetpreviousAbilityMissionInfosWrap(napi_env env, napi_callback_i
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 1, &ret));
return ret;
@ -653,7 +653,7 @@ napi_value NAPI_QueryRunningAbilityMissionInfosWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -786,7 +786,7 @@ napi_value NAPI_GetActiveAbilityMissionInfosWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -914,7 +914,7 @@ napi_value NAPI_GetAllRunningProcessesWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1032,7 +1032,7 @@ napi_value NAPI_GetActiveProcessInfosWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1150,7 +1150,7 @@ napi_value NAPI_RemoveMissionWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1276,7 +1276,7 @@ napi_value NAPI_RemoveMissionsWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1413,7 +1413,7 @@ napi_value NAPI_ClearMissionsWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1531,7 +1531,7 @@ napi_value NAPI_MoveMissionToTopWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1656,7 +1656,7 @@ napi_value NAPI_KillProcessesByBundleNameWrap(
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1780,7 +1780,7 @@ napi_value NAPI_ClearUpApplicationDataWrap(napi_env env, napi_callback_info info
&async_callback_info.asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info.asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -1908,7 +1908,7 @@ napi_value NAPI_GetAbilityMissionSnapshotWrap(
&async_callback_info->asyncWork);
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info->asyncWork));
// create reutrn
// create return
napi_value ret = 0;
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
return ret;
@ -2226,7 +2226,7 @@ napi_value NAPI_GetSystemMemoryAttr(napi_env env, napi_callback_info info)
HILOG_INFO("%{public}s argc = [%{public}zu]", __func__, argc);
if (argc == 0) {
// promiss
// promise
ret = GetSystemMemoryAttrPromiss(env);
} else if (argc == 1) {
// async

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -69,6 +69,7 @@ int AbilityConnectManager::TerminateAbility(const std::shared_ptr<AbilityRecord>
});
if (!targetAbility) {
HILOG_ERROR("targetAbility error.");
return NO_FOUND_ABILITY_BY_CALLER;
}
if (result != ERR_OK) {

View File

@ -218,7 +218,7 @@ bool AbilityManagerService::Init()
HILOG_INFO("file exists");
return;
}
HILOG_INFO("no such file,creat...");
HILOG_INFO("no such file,create...");
std::ofstream outFile(AmsWhiteList::AMS_WHITE_LIST_FILE_PATH, std::ios::out);
outFile.close();
};
@ -3639,7 +3639,7 @@ int AbilityManagerService::CheckCallPermissions(const AbilityRequest &abilityReq
std::string bundleName;
bool result = bms->GetBundleNameForUid(callerUid, bundleName);
if (!result) {
HILOG_ERROR("GetBundleNameForUid frome bms fail.");
HILOG_ERROR("GetBundleNameForUid from bms fail.");
return RESOLVE_CALL_NO_PERMISSIONS;
}
if (bundleName != abilityInfo.bundleName && callerUid != targetUid && !isTargetSystemApp) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License")_;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -13,11 +13,12 @@
* limitations under the License.
*/
#include "form_host_callback.h"
#include <cinttypes>
#include "appexecfwk_errors.h"
#include "app_log_wrapper.h"
#include "form_host_callback.h"
#include "form_host_interface.h"
#include "form_task_mgr.h"
#include "string_ex.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -57,7 +57,7 @@ bool FormHostRecord::Contains(int64_t formId) const
/**
* @brief Set refresh enable flag.
* @param formId The Id of the form.
* @param flag True for enbale, false for disable.
* @param flag True for enable, false for disable.
*/
void FormHostRecord::SetEnableRefresh(int64_t formId, bool flag)
{
@ -69,7 +69,7 @@ void FormHostRecord::SetEnableRefresh(int64_t formId, bool flag)
/**
* @brief Refresh enable or not.
* @param formId The Id of the form.
* @return true on enbale, false on disable..
* @return true on enable, false on disable..
*/
bool FormHostRecord::IsEnableRefresh(int64_t formId) const
{
@ -82,7 +82,7 @@ bool FormHostRecord::IsEnableRefresh(int64_t formId) const
/**
* @brief Set need refresh enable flag.
* @param formId The Id of the form.
* @param flag True for enbale, false for disable.
* @param flag True for enable, false for disable.
*/
void FormHostRecord::SetNeedRefresh(int64_t formId, bool flag)
{
@ -91,7 +91,7 @@ void FormHostRecord::SetNeedRefresh(int64_t formId, bool flag)
/**
* @brief Need Refresh enable or not.
* @param formId The Id of the form.
* @return true on enbale, false on disable..
* @return true on enable, false on disable..
*/
bool FormHostRecord::IsNeedRefresh(int64_t formId) const
{

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -14,12 +14,13 @@
* limitations under the License.
*/
#include "form_msg_event_connection.h"
#include <cinttypes>
#include "appexecfwk_errors.h"
#include "app_log_wrapper.h"
#include "form_constants.h"
#include "form_msg_event_connection.h"
#include "form_supply_callback.h"
#include "form_task_mgr.h"
#include "ipc_types.h"

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -14,12 +14,13 @@
* limitations under the License.
*/
#include "form_refresh_connection.h"
#include <cinttypes>
#include "appexecfwk_errors.h"
#include "app_log_wrapper.h"
#include "form_constants.h"
#include "form_refresh_connection.h"
#include "form_supply_callback.h"
#include "form_task_mgr.h"
#include "ipc_types.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,11 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mock_form_host_client.h"
#include <gtest/gtest.h>
#include "appexecfwk_errors.h"
#include "app_log_wrapper.h"
#include "errors.h"
#include "mock_form_host_client.h"
#include "string_ex.h"
namespace OHOS {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -621,7 +621,7 @@ void FifthAbility::WantParamsMarshallingCase7(int code)
wParams.Marshalling(in);
WantParams *wantParamsOut = WantParams::Unmarshalling(in);
#ifdef WANT_PARAM_USE_LONG
bool result = (Long)::Unbox(ILong::Query(wantParamsOut->GetParam(key))) == value);
bool result = (Long)::Unbox(ILong::Query(wantParamsOut->GetParam(key))) == value;
#else
bool result = (String::Unbox(IString::Query(wantParamsOut->GetParam(key))) == strValue);
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -42,7 +42,7 @@ void TestObserverProxy::TestStatus(const std::string &msg, const int &resultCode
sptr<IRemoteObject> remote = Remote();
if (remote == nullptr) {
HILOG_ERROR("Failed to send cmd to service due to remote objetc is null");
HILOG_ERROR("Failed to send cmd to service due to remote object is null");
return;
}
@ -78,7 +78,7 @@ void TestObserverProxy::TestFinished(const std::string &msg, const int &resultCo
sptr<IRemoteObject> remote = Remote();
if (remote == nullptr) {
HILOG_ERROR("Failed to send cmd to service due to remote objetc is null");
HILOG_ERROR("Failed to send cmd to service due to remote object is null");
return;
}
@ -116,7 +116,7 @@ ShellCommandResult TestObserverProxy::ExecuteShellCommand(
sptr<IRemoteObject> remote = Remote();
if (remote == nullptr) {
HILOG_ERROR("Failed to send cmd to service due to remote objetc is null");
HILOG_ERROR("Failed to send cmd to service due to remote object is null");
return result;
}