diff --git a/README_zh.md b/README_zh.md old mode 100755 new mode 100644 index 3ec64863..dff1870d --- a/README_zh.md +++ b/README_zh.md @@ -61,15 +61,15 @@ foundation/ └──foundation/aafwk/standard    ├── frameworks    │   └── kits -   │   └── ability # AbilityKit实现的核心代码 +   │   └── ability # AbilityKit实现的核心代码    ├── interfaces    │   └── innerkits -   │      └── want # Ability之间交互的信息载体的对外接口 - └── services - ├── abilitymgr # Ability管理服务框架代码 -   ├── common # 日志组件目录 -   ├── test # 测试目录 -   └── tools # aa命令代码目录 +   │     └── want # Ability之间交互的信息载体的对外接口 + ├── services + │ ├── abilitymgr # Ability管理服务框架代码 + │  ├── common # 日志组件目录 + │  └── test # 测试目录 + └── tools # aa命令代码目录 ``` ## 使用说明 diff --git a/common/task_dispatcher/include/dispatcher/spec_dispatcher_config.h b/common/task_dispatcher/include/dispatcher/spec_dispatcher_config.h index 8a5ecab5..4967838a 100644 --- a/common/task_dispatcher/include/dispatcher/spec_dispatcher_config.h +++ b/common/task_dispatcher/include/dispatcher/spec_dispatcher_config.h @@ -31,7 +31,7 @@ public: name_ = name; priority_ = priority; } - ~SpecDispatcherConfig(){}; + virtual ~SpecDispatcherConfig() = default; std::string GetName() { return name_; diff --git a/common/task_dispatcher/include/threading/default_worker_pool_config.h b/common/task_dispatcher/include/threading/default_worker_pool_config.h index 45e19983..ac0cf6a9 100644 --- a/common/task_dispatcher/include/threading/default_worker_pool_config.h +++ b/common/task_dispatcher/include/threading/default_worker_pool_config.h @@ -31,11 +31,11 @@ public: DefaultWorkerPoolConfig() = default; virtual ~DefaultWorkerPoolConfig() = default; - int GetMaxThreadCount(void) const override; + int GetMaxThreadCount() const override; - int GetCoreThreadCount(void) const override; + int GetCoreThreadCount() const override; - long GetKeepAliveTime(void) const override; + long GetKeepAliveTime() const override; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp b/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp index 41f3dce6..4edb2a9c 100644 --- a/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp +++ b/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp @@ -42,10 +42,6 @@ ErrCode SpecTaskDispatcher::SyncDispatch(const std::shared_ptr &runnab } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); - if (innerTask == nullptr) { - HILOG_ERROR("SpecTaskDispatcher::SyncDispatch innerTask is nullptr"); - return ERR_APPEXECFWK_CHECK_FAILED; - } TracePointBeforePost(innerTask, false, SYNC_DISPATCHER_TAG); HILOG_INFO("SpecTaskDispatcher::SyncDispatch into new sync task"); handler_->DispatchSync(runnable); @@ -68,10 +64,6 @@ std::shared_ptr SpecTaskDispatcher::AsyncDispatch(const std::shared_p } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); - if (innerTask == nullptr) { - HILOG_ERROR("SpecTaskDispatcher::AsyncDispatch innerTask is nullptr"); - return nullptr; - } TracePointBeforePost(innerTask, true, ASYNC_DISPATCHER_TAG); HILOG_INFO("SpecTaskDispatcher::AsyncDispatch into new async task"); handler_->Dispatch(runnable); @@ -92,10 +84,6 @@ std::shared_ptr SpecTaskDispatcher::DelayDispatch(const std::shared_p } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); - if (innerTask == nullptr) { - HILOG_ERROR("SpecTaskDispatcher::DelayDispatch innerTask is nullptr"); - return nullptr; - } TracePointBeforePost(innerTask, true, DELAY_DISPATCHER_TAG); handler_->Dispatch(runnable, delayMs); HILOG_INFO("SpecTaskDispatcher::DelayDispatch end"); diff --git a/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp b/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp index a760c32b..8af0c454 100644 --- a/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp +++ b/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp @@ -130,9 +130,6 @@ int TaskDispatcherContext::MapPriorityIndex(TaskPriority priority) const default: return DEFAULT_PRIORITY_INDEX; } - HILOG_ERROR("TaskDispatcherContext.mapPriorityIndex unhandled priority=%{public}d", priority); - - return DEFAULT_PRIORITY_INDEX; } std::shared_ptr TaskDispatcherContext::GetGlobalTaskDispatcher(TaskPriority priority) diff --git a/common/task_dispatcher/src/threading/default_thread_factory.cpp b/common/task_dispatcher/src/threading/default_thread_factory.cpp index 5dbf3147..901b5a81 100644 --- a/common/task_dispatcher/src/threading/default_thread_factory.cpp +++ b/common/task_dispatcher/src/threading/default_thread_factory.cpp @@ -23,14 +23,10 @@ DefaultThreadFactory::DefaultThreadFactory() : index_(1) std::shared_ptr DefaultThreadFactory::Create() { std::shared_ptr pThread = std::make_shared(); - if (pThread != nullptr) { - int value = std::atomic_fetch_add(&index_, 1); - std::string name = std::string("PoolThread-") + std::to_string(value); - pThread->thread_name_ = name; - HILOG_INFO("DefaultThreadFactory::Create thread name is %{public}s", name.c_str()); - } else { - HILOG_ERROR("DefaultThreadFactory::Create error, thread is nullptr"); - } + int value = std::atomic_fetch_add(&index_, 1); + std::string name = std::string("PoolThread-") + std::to_string(value); + pThread->thread_name_ = name; + HILOG_INFO("DefaultThreadFactory::Create thread name is %{public}s", name.c_str()); return pThread; } diff --git a/common/task_dispatcher/src/threading/default_worker_pool_config.cpp b/common/task_dispatcher/src/threading/default_worker_pool_config.cpp index 40456729..26bd555d 100644 --- a/common/task_dispatcher/src/threading/default_worker_pool_config.cpp +++ b/common/task_dispatcher/src/threading/default_worker_pool_config.cpp @@ -16,17 +16,17 @@ namespace OHOS { namespace AppExecFwk { -int DefaultWorkerPoolConfig::GetMaxThreadCount(void) const +int DefaultWorkerPoolConfig::GetMaxThreadCount() const { return DEFAULT_MAX_THREAD_COUNT; } -int DefaultWorkerPoolConfig::GetCoreThreadCount(void) const +int DefaultWorkerPoolConfig::GetCoreThreadCount() const { return DEFAULT_CORE_THREAD_COUNT; } -long DefaultWorkerPoolConfig::GetKeepAliveTime(void) const +long DefaultWorkerPoolConfig::GetKeepAliveTime() const { return DEFAULT_KEEP_ALIVE_TIME; } diff --git a/common/task_dispatcher/src/threading/task_executor.cpp b/common/task_dispatcher/src/threading/task_executor.cpp index ec1b01a7..1739db39 100644 --- a/common/task_dispatcher/src/threading/task_executor.cpp +++ b/common/task_dispatcher/src/threading/task_executor.cpp @@ -205,7 +205,7 @@ void TaskExecutor::Consume() for (;;) { if (terminated_.load() && delayTasks_->Empty()) { HILOG_INFO("TaskExecutor::Consume delay task is empty"); - break; + return; } std::shared_ptr delayTaskWrapper = delayTasks_->Take(); if (delayTaskWrapper == nullptr || delayTaskWrapper->runnable_ == nullptr) { diff --git a/figures/aafwk.png b/figures/aafwk.png old mode 100755 new mode 100644 diff --git a/figures/page-ability-lifecycle-callbacks.png b/figures/page-ability-lifecycle-callbacks.png old mode 100755 new mode 100644 diff --git a/figures/page-ability-lifecycle.png b/figures/page-ability-lifecycle.png old mode 100755 new mode 100644 diff --git a/figures/service-ability-lifecycle.png b/figures/service-ability-lifecycle.png old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/ability_runtime/BUILD.gn b/frameworks/kits/ability/ability_runtime/BUILD.gn old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/ability_runtime/include/ability_connect_callback.h b/frameworks/kits/ability/ability_runtime/include/ability_connect_callback.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/ability_runtime/include/ability_connection.h b/frameworks/kits/ability/ability_runtime/include/ability_connection.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/ability_runtime/include/connection_manager.h b/frameworks/kits/ability/ability_runtime/include/connection_manager.h old mode 100755 new mode 100644 index f9efa438..cd7e8e0a --- a/frameworks/kits/ability/ability_runtime/include/connection_manager.h +++ b/frameworks/kits/ability/ability_runtime/include/connection_manager.h @@ -139,6 +139,8 @@ private: const AppExecFwk::ElementName &connectReceiver, sptr abilityConnection, const sptr &connectCallback); std::map>> abilityConnections_; + ErrCode ConnectAbilityInner(const sptr &connectCaller, + const AAFwk::Want &want, int accountId, const sptr &connectCallback); }; } // namespace AbilityRuntime } // namespace OHOS diff --git a/frameworks/kits/ability/ability_runtime/src/ability_connection.cpp b/frameworks/kits/ability/ability_runtime/src/ability_connection.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/ability_runtime/src/connection_manager.cpp b/frameworks/kits/ability/ability_runtime/src/connection_manager.cpp old mode 100755 new mode 100644 index ce4be858..56f2a21f --- a/frameworks/kits/ability/ability_runtime/src/connection_manager.cpp +++ b/frameworks/kits/ability/ability_runtime/src/connection_manager.cpp @@ -33,57 +33,17 @@ ConnectionManager& ConnectionManager::GetInstance() ErrCode ConnectionManager::ConnectAbility(const sptr &connectCaller, const AAFwk::Want &want, const sptr &connectCallback) { - if (connectCaller == nullptr || connectCallback == nullptr) { - HILOG_ERROR("%{public}s, connectCaller or connectCallback is nullptr.", __func__); - return ERR_INVALID_VALUE; - } - - AppExecFwk::ElementName connectReceiver = want.GetElement(); - HILOG_DEBUG("%{public}s begin, connectCaller: %{public}p, connectReceiver: %{public}s.", - __func__, connectCaller.GetRefPtr(), - (connectReceiver.GetBundleName() + ":" + connectReceiver.GetAbilityName()).c_str()); - - sptr abilityConnection; - auto item = std::find_if(abilityConnections_.begin(), abilityConnections_.end(), - [&connectCaller, &connectReceiver](const std::map>>::value_type &obj) { - return connectCaller == obj.first.connectCaller && - connectReceiver.GetBundleName() == obj.first.connectReceiver.GetBundleName() && - connectReceiver.GetAbilityName() == obj.first.connectReceiver.GetAbilityName(); - }); - if (item != abilityConnections_.end()) { - std::vector> callbacks = item->second; - callbacks.push_back(connectCallback); - abilityConnections_[item->first] = callbacks; - abilityConnection = item->first.abilityConnection; - abilityConnection->SetConnectCallback(connectCallback); - HILOG_INFO("%{public}s end, find abilityConnection:%{public}p exist, callbackSize:%{public}d.", - __func__, abilityConnection.GetRefPtr(), (int32_t)callbacks.size()); - if (abilityConnection->GetResultCode() == ERR_OK) { - connectCallback->OnAbilityConnectDone(connectReceiver, abilityConnection->GetRemoteObject(), - abilityConnection->GetResultCode()); - return ERR_OK; - } else { - return HandleCallbackTimeOut(connectCaller, want, connectReceiver, abilityConnection, connectCallback); - } - } else { - abilityConnection = new AbilityConnection(connectCallback); - ErrCode ret = - AAFwk::AbilityManagerClient::GetInstance()->ConnectAbility(want, abilityConnection, connectCaller); - if (ret == ERR_OK) { - ConnectionInfo connectionInfo(connectCaller, connectReceiver, abilityConnection); - std::vector> callbacks; - callbacks.push_back(connectCallback); - abilityConnections_[connectionInfo] = callbacks; - } - HILOG_DEBUG("%{public}s end, not find connection, connection: %{public}p, abilityConnectionsSize:%{public}d.", - __func__, abilityConnection.GetRefPtr(), (int32_t)abilityConnections_.size()); - return ret; - } + return ConnectAbilityInner(connectCaller, want, AAFwk::DEFAULT_INVAL_VALUE, connectCallback); } ErrCode ConnectionManager::ConnectAbilityWithAccount(const sptr &connectCaller, const AAFwk::Want &want, int accountId, const sptr &connectCallback) +{ + return ConnectAbilityInner(connectCaller, want, accountId, connectCallback); +} + +ErrCode ConnectionManager::ConnectAbilityInner(const sptr &connectCaller, + const AAFwk::Want &want, int accountId, const sptr &connectCallback) { if (connectCaller == nullptr || connectCallback == nullptr) { HILOG_ERROR("%{public}s, connectCaller or connectCallback is nullptr.", __func__); diff --git a/frameworks/kits/ability/native/BUILD.gn b/frameworks/kits/ability/native/BUILD.gn index ee2ebad8..51f53363 100644 --- a/frameworks/kits/ability/native/BUILD.gn +++ b/frameworks/kits/ability/native/BUILD.gn @@ -326,7 +326,6 @@ ohos_shared_library("dummy_classes") { sources = [ "${SUBSYSTEM_DIR}/src/dummy_data_ability_predicates_discard.cpp", "${SUBSYSTEM_DIR}/src/dummy_result_set_discard.cpp", - "${SUBSYSTEM_DIR}/src/dummy_values_bucket_discard.cpp", ] configs = [ ":ability_config" ] diff --git a/frameworks/kits/ability/native/include/ability_impl.h b/frameworks/kits/ability/native/include/ability_impl.h index c870115c..ee668f5f 100644 --- a/frameworks/kits/ability/native/include/ability_impl.h +++ b/frameworks/kits/ability/native/include/ability_impl.h @@ -463,6 +463,7 @@ private: class InputEventConsumerImpl : public MMI::IInputEventConsumer { public: explicit InputEventConsumerImpl(const std::shared_ptr& abilityImpl) : abilityImpl_(abilityImpl) {} + ~InputEventConsumerImpl() = default; void OnInputEvent(std::shared_ptr keyEvent) const override; void OnInputEvent(std::shared_ptr pointerEvent) const override; void OnInputEvent(std::shared_ptr axisEvent) const override {} diff --git a/frameworks/kits/ability/native/include/ability_runtime/js_ability_context.h b/frameworks/kits/ability/native/include/ability_runtime/js_ability_context.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/include/js_service_extension_context.h b/frameworks/kits/ability/native/include/js_service_extension_context.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/include/service_extension.h b/frameworks/kits/ability/native/include/service_extension.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/src/ability_impl.cpp b/frameworks/kits/ability/native/src/ability_impl.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/src/dummy_values_bucket_discard.cpp b/frameworks/kits/ability/native/src/dummy_values_bucket_discard.cpp deleted file mode 100644 index 42970b17..00000000 --- a/frameworks/kits/ability/native/src/dummy_values_bucket_discard.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2021 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/form_provider_client.cpp b/frameworks/kits/ability/native/src/form_provider_client.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/src/js_service_extension.cpp b/frameworks/kits/ability/native/src/js_service_extension.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/src/js_service_extension_context.cpp b/frameworks/kits/ability/native/src/js_service_extension_context.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/ability/native/src/service_extension.cpp b/frameworks/kits/ability/native/src/service_extension.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/ability_delegator/include/runner_runtime/js_test_runner.h b/frameworks/kits/appkit/native/ability_delegator/include/runner_runtime/js_test_runner.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/ability_delegator/src/runner_runtime/js_test_runner.cpp b/frameworks/kits/appkit/native/ability_delegator/src/runner_runtime/js_test_runner.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/ability_runtime/context/context.h b/frameworks/kits/appkit/native/ability_runtime/context/context.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/ability_runtime/context/js_context_utils.cpp b/frameworks/kits/appkit/native/ability_runtime/context/js_context_utils.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/ability_runtime/service_extension_context.cpp b/frameworks/kits/appkit/native/ability_runtime/service_extension_context.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/ability_runtime/service_extension_context.h b/frameworks/kits/appkit/native/ability_runtime/service_extension_context.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/app/include/application_context.h b/frameworks/kits/appkit/native/app/include/application_context.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/app/include/context_container.h b/frameworks/kits/appkit/native/app/include/context_container.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/app/include/context_deal.h b/frameworks/kits/appkit/native/app/include/context_deal.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/app/src/application_context.cpp b/frameworks/kits/appkit/native/app/src/application_context.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/native/test/unittest/ability_start_setting_test.cpp b/frameworks/kits/appkit/native/test/unittest/ability_start_setting_test.cpp old mode 100755 new mode 100644 diff --git a/frameworks/kits/appkit/test/Mock/include/mock_app_mgr_service.h b/frameworks/kits/appkit/test/Mock/include/mock_app_mgr_service.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/fmskit/native/include/form_host_client.h b/frameworks/kits/fmskit/native/include/form_host_client.h old mode 100755 new mode 100644 diff --git a/frameworks/kits/fmskit/native/src/form_host_client.cpp b/frameworks/kits/fmskit/native/src/form_host_client.cpp old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/ability_manager/include/remote_mission_listener_interface.h b/interfaces/innerkits/ability_manager/include/remote_mission_listener_interface.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/ability_manager/include/remote_mission_listener_proxy.h b/interfaces/innerkits/ability_manager/include/remote_mission_listener_proxy.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/ability_manager/include/remote_mission_listener_stub.h b/interfaces/innerkits/ability_manager/include/remote_mission_listener_stub.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/ability_manager/include/shared_memory.h b/interfaces/innerkits/ability_manager/include/shared_memory.h index 7e5f9825..787a1ebb 100644 --- a/interfaces/innerkits/ability_manager/include/shared_memory.h +++ b/interfaces/innerkits/ability_manager/include/shared_memory.h @@ -23,9 +23,9 @@ public: SharedMemory() = default; ~SharedMemory() = default; - static void ReleaseShmId(const int shmId); + static void ReleaseShmId(int shmId); static void* PopSharedMemory(int shmKey, int size); - static int PushSharedMemory(const void *data, const int size); + static int PushSharedMemory(const void *data, int size); }; } // namespace AAFwk } // namespace OHOS diff --git a/interfaces/innerkits/ability_manager/include/stop_user_callback_proxy.h b/interfaces/innerkits/ability_manager/include/stop_user_callback_proxy.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/ability_manager/include/stop_user_callback_stub.h b/interfaces/innerkits/ability_manager/include/stop_user_callback_stub.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp b/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/form_manager/include/form_js_info.h b/interfaces/innerkits/form_manager/include/form_js_info.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/form_manager/include/form_provider_data.h b/interfaces/innerkits/form_manager/include/form_provider_data.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/form_manager/src/form_js_info.cpp b/interfaces/innerkits/form_manager/src/form_js_info.cpp old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/form_manager/src/form_provider_data.cpp b/interfaces/innerkits/form_manager/src/form_provider_data.cpp old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/ability/ability.js b/interfaces/kits/napi/aafwk/ability/ability.js old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/ability_context/ability_context.js b/interfaces/kits/napi/aafwk/ability_context/ability_context.js old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/app/appMgr/app_mgr.cpp b/interfaces/kits/napi/aafwk/app/appMgr/app_mgr.cpp old mode 100755 new mode 100644 index fb8a698d..bec91225 --- a/interfaces/kits/napi/aafwk/app/appMgr/app_mgr.cpp +++ b/interfaces/kits/napi/aafwk/app/appMgr/app_mgr.cpp @@ -74,8 +74,11 @@ napi_value NAPI_KillProcessesByBundleName(napi_env env, napi_callback_info info) NAPI_ASSERT(env, valuetype == napi_function, "Wrong argument type. Function expected."); } - AsyncCallbackInfo *async_callback_info = - new AsyncCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr }; + AsyncCallbackInfo *async_callback_info = new AsyncCallbackInfo { + .env = env, + .asyncWork = nullptr, + .deferred = nullptr + }; std::string bundleName; ParseBundleName(env, bundleName, argv[0]); diff --git a/interfaces/kits/napi/aafwk/app/context/context.js b/interfaces/kits/napi/aafwk/app/context/context.js old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/app/test_runner/test_runner.js b/interfaces/kits/napi/aafwk/app/test_runner/test_runner.js old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/extensioncontext/extension_context.js b/interfaces/kits/napi/aafwk/extensioncontext/extension_context.js old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.cpp b/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.cpp index 98945710..5ecab7f0 100644 --- a/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.cpp +++ b/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.cpp @@ -209,7 +209,7 @@ napi_value UnwrapDataAbilityPredicatesBackReferences( return result; } -void SetNamedProperty(napi_env env, napi_value obj, const char *propName, const int propValue) +void SetNamedProperty(napi_env env, napi_value obj, const char *propName, int propValue) { napi_value prop = nullptr; napi_create_int32(env, propValue, &prop); diff --git a/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.h b/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.h index 4ce8dbe6..66dbbe10 100644 --- a/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.h +++ b/interfaces/kits/napi/aafwk/featureAbility/napi_data_ability_operation.h @@ -33,7 +33,7 @@ namespace AppExecFwk { * @return The return value from Init is treated as the exports object for the module. */ napi_value DataAbilityOperationInit(napi_env env, napi_value exports); -void SetNamedProperty(napi_env env, napi_value obj, const char *propName, const int propValue); +void SetNamedProperty(napi_env env, napi_value obj, const char *propName, int propValue); /** * @brief Parse the dataAbilityOperation parameters. * @@ -47,7 +47,7 @@ napi_value UnwrapDataAbilityOperation(std::shared_ptr &par napi_value BuildDataAbilityOperation( std::shared_ptr &dataAbilityOperation, napi_env env, napi_value param); bool GetDataAbilityOperationBuilder( - std::shared_ptr &builder, const int type, const std::shared_ptr &uri); + std::shared_ptr &builder, int type, const std::shared_ptr &uri); /** * @brief Parse the ValuesBucket parameters. * diff --git a/interfaces/kits/napi/aafwk/inner/napi_common/napi_common_util.cpp b/interfaces/kits/napi/aafwk/inner/napi_common/napi_common_util.cpp index 4d724479..9425defe 100644 --- a/interfaces/kits/napi/aafwk/inner/napi_common/napi_common_util.cpp +++ b/interfaces/kits/napi/aafwk/inner/napi_common/napi_common_util.cpp @@ -541,6 +541,47 @@ bool UnwrapArrayStringFromJS(napi_env env, napi_value param, std::vector 0.0) { + isDouble = true; + if (value.intList.size() > 0) { + for (size_t j = 0; j < value.intList.size(); j++) { + value.doubleList.push_back(value.intList[j]); + } + value.intList.clear(); + } + value.doubleList.push_back(elementDouble); + } else { + value.intList.push_back(elementInt32); + } + } else if (isReadValue32) { + value.intList.push_back(elementInt32); + } else if (isReadDouble) { + isDouble = true; + if (value.intList.size() > 0) { + for (size_t j = 0; j < value.intList.size(); j++) { + value.doubleList.push_back(value.intList[j]); + } + value.intList.clear(); + } + value.doubleList.push_back(elementDouble); + } + return isDouble; +} + bool UnwrapArrayComplexFromJS(napi_env env, napi_value param, ComplexArrayData &value) { uint32_t arraySize = 0; @@ -580,42 +621,7 @@ bool UnwrapArrayComplexFromJS(napi_env env, napi_value param, ComplexArrayData & break; } case napi_number: { - int32_t elementInt32 = 0; - double elementDouble = 0.0; - if (isDouble) { - if (napi_get_value_double(env, jsValue, &elementDouble) == napi_ok) { - value.doubleList.push_back(elementDouble); - } - break; - } else { - bool isReadValue32 = napi_get_value_int32(env, jsValue, &elementInt32) == napi_ok; - bool isReadDouble = napi_get_value_double(env, jsValue, &elementDouble) == napi_ok; - if (isReadValue32 && isReadDouble) { - if (abs(elementDouble - elementInt32 * 1.0) > 0.0) { - isDouble = true; - if (value.intList.size() > 0) { - for (size_t j = 0; j < value.intList.size(); j++) { - value.doubleList.push_back(value.intList[j]); - } - value.intList.clear(); - } - value.doubleList.push_back(elementDouble); - } else { - value.intList.push_back(elementInt32); - } - } else if (isReadValue32) { - value.intList.push_back(elementInt32); - } else if (isReadDouble) { - isDouble = true; - if (value.intList.size() > 0) { - for (size_t j = 0; j < value.intList.size(); j++) { - value.doubleList.push_back(value.intList[j]); - } - value.intList.clear(); - } - value.doubleList.push_back(elementDouble); - } - } + isDouble = UnwrapArrayComplexFromJSNumber(env, value, isDouble, jsValue); break; } default: @@ -1169,7 +1175,10 @@ std::vector ConvertU8Vector(napi_env env, napi_value jsValue) NAPI_CALL_BASE(env, napi_get_arraybuffer_info(env, buffer, reinterpret_cast(&data), &total), {}); length = std::min(length, total - offset); std::vector result(sizeof(uint8_t) + length); - memcpy_s(result.data(), result.size(), &data[offset], length); + int retCode = memcpy_s(result.data(), result.size(), &data[offset], length); + if (retCode != 0) { + return {}; + } return result; } diff --git a/interfaces/kits/napi/aafwk/service_extension_context/service_extension_context.js b/interfaces/kits/napi/aafwk/service_extension_context/service_extension_context.js old mode 100755 new mode 100644 diff --git a/interfaces/kits/napi/aafwk/serviceextension/service_extension.js b/interfaces/kits/napi/aafwk/serviceextension/service_extension.js old mode 100755 new mode 100644 diff --git a/services/abilitymgr/include/ability_util.h b/services/abilitymgr/include/ability_util.h old mode 100755 new mode 100644 diff --git a/services/abilitymgr/include/connection_record.h b/services/abilitymgr/include/connection_record.h old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/ability_connect_callback_stub.cpp b/services/abilitymgr/src/ability_connect_callback_stub.cpp index 49c2e203..613e5d00 100644 --- a/services/abilitymgr/src/ability_connect_callback_stub.cpp +++ b/services/abilitymgr/src/ability_connect_callback_stub.cpp @@ -42,6 +42,7 @@ void AbilityConnectionProxy::OnAbilityConnectDone( MessageOption option; if (!WriteInterfaceToken(data)) { + HILOG_ERROR("Write interface token failed."); return; } @@ -75,6 +76,7 @@ void AbilityConnectionProxy::OnAbilityDisconnectDone(const AppExecFwk::ElementNa MessageOption option(MessageOption::TF_ASYNC); if (!WriteInterfaceToken(data)) { + HILOG_ERROR("Write interface token failed."); return; } if (!data.WriteParcelable(&element) || !data.WriteInt32(resultCode)) { diff --git a/services/abilitymgr/src/ability_connect_manager.cpp b/services/abilitymgr/src/ability_connect_manager.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/connection_record.cpp b/services/abilitymgr/src/connection_record.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/lifecycle_deal.cpp b/services/abilitymgr/src/lifecycle_deal.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/lock_screen_white_list.cpp b/services/abilitymgr/src/lock_screen_white_list.cpp index 043e246d..a9b77509 100644 --- a/services/abilitymgr/src/lock_screen_white_list.cpp +++ b/services/abilitymgr/src/lock_screen_white_list.cpp @@ -114,11 +114,10 @@ bool LockScreenWhiteList::FindBundleNameOnWhiteList(const std::string &bundleNam isAwakenScreen = jsonFile.at(bundleName).at(AmsWhiteList::ISAWAKEN_SCREEN).get(); jsonFile.clear(); return true; - } else { - HILOG_INFO("json info not contains bundleName..."); - jsonFile.clear(); - return false; } + HILOG_INFO("json info not contains bundleName..."); + jsonFile.clear(); + return false; } bool LockScreenWhiteList::IsExistFile(const std::string &path) diff --git a/services/abilitymgr/src/remote_mission_listener_proxy.cpp b/services/abilitymgr/src/remote_mission_listener_proxy.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/remote_mission_listener_stub.cpp b/services/abilitymgr/src/remote_mission_listener_stub.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/shared_memory.cpp b/services/abilitymgr/src/shared_memory.cpp index d73188b7..38cbc82d 100644 --- a/services/abilitymgr/src/shared_memory.cpp +++ b/services/abilitymgr/src/shared_memory.cpp @@ -34,7 +34,7 @@ constexpr unsigned int SHM_READ_WRITE_PERMISSIONS = 0666U; #endif } -void SharedMemory::ReleaseShmId(const int shmId) +void SharedMemory::ReleaseShmId(int shmId) { if (shmId == -1) { return; @@ -45,7 +45,7 @@ void SharedMemory::ReleaseShmId(const int shmId) } } -int SharedMemory::PushSharedMemory(const void *data, const int size) +int SharedMemory::PushSharedMemory(const void *data, int size) { // internal call, no need to check null. static int shmKey = SHM_KEY_START; diff --git a/services/abilitymgr/src/stop_user_callback_proxy.cpp b/services/abilitymgr/src/stop_user_callback_proxy.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/src/stop_user_callback_stub.cpp b/services/abilitymgr/src/stop_user_callback_stub.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/test/unittest/phone/ability_manager_service_account_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_manager_service_account_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/abilitymgr/test/unittest/phone/connection_record_test/connection_record_test.cpp b/services/abilitymgr/test/unittest/phone/connection_record_test/connection_record_test.cpp old mode 100755 new mode 100644 diff --git a/services/abilitymgr/test/unittest/phone/mission_list_manager_ut_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/mission_list_manager_ut_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/appmgr/src/app_mgr_service.cpp b/services/appmgr/src/app_mgr_service.cpp old mode 100755 new mode 100644 diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index e71df59b..29dfabea 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -358,6 +358,11 @@ void AppMgrServiceInner::ApplicationBackgrounded(const int32_t recordId) void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); + if (!appRunningManager_) { + HILOG_ERROR("appRunningManager_ is nullptr"); + return; + } + auto appRecord = GetAppRunningRecordByAppRecordId(recordId); if (!appRecord) { HILOG_ERROR("get app record failed"); diff --git a/services/appmgr/test/mock/include/mock_bundle_manager.h b/services/appmgr/test/mock/include/mock_bundle_manager.h old mode 100755 new mode 100644 diff --git a/services/formmgr/src/form_data_mgr.cpp b/services/formmgr/src/form_data_mgr.cpp index fd498d5b..297f166f 100644 --- a/services/formmgr/src/form_data_mgr.cpp +++ b/services/formmgr/src/form_data_mgr.cpp @@ -237,13 +237,14 @@ int FormDataMgr::CheckEnoughForm(const int callingUid, const int32_t currentUser return ERR_APPEXECFWK_FORM_MAX_SYSTEM_FORMS; } for (auto &userUid : record.formUserUids) { - if (userUid == callingUid) { - if (++callingUidFormCounts >= Constants::MAX_RECORD_PER_APP) { - HILOG_WARN("%{public}s, already use %{public}d forms", __func__, Constants::MAX_RECORD_PER_APP); - return ERR_APPEXECFWK_FORM_MAX_FORMS_PER_CLIENT; - } - break; + if (userUid != callingUid) { + continue; } + if (++callingUidFormCounts >= Constants::MAX_RECORD_PER_APP) { + HILOG_WARN("%{public}s, already use %{public}d forms", __func__, Constants::MAX_RECORD_PER_APP); + return ERR_APPEXECFWK_FORM_MAX_FORMS_PER_CLIENT; + } + break; } } } diff --git a/services/formmgr/src/form_delete_connection.cpp b/services/formmgr/src/form_delete_connection.cpp old mode 100755 new mode 100644 diff --git a/services/formmgr/test/mock/include/mock_bundle_manager.h b/services/formmgr/test/mock/include/mock_bundle_manager.h old mode 100755 new mode 100644 diff --git a/services/test/moduletest/call_module_test/BUILD.gn b/services/test/moduletest/call_module_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/BUILD.gn b/services/test/moduletest/common/ams/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/ability_running_record_test/BUILD.gn b/services/test/moduletest/common/ams/ability_running_record_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/app_life_cycle_test/BUILD.gn b/services/test/moduletest/common/ams/app_life_cycle_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/app_life_cycle_test/ams_app_life_cycle_module_test.cpp b/services/test/moduletest/common/ams/app_life_cycle_test/ams_app_life_cycle_module_test.cpp old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/app_recent_list_test/BUILD.gn b/services/test/moduletest/common/ams/app_recent_list_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/app_running_record_test/BUILD.gn b/services/test/moduletest/common/ams/app_running_record_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/app_service_flow_test/BUILD.gn b/services/test/moduletest/common/ams/app_service_flow_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/ipc_app_mgr_test/BUILD.gn b/services/test/moduletest/common/ams/ipc_app_mgr_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/test/moduletest/common/ams/ipc_app_scheduler_test/BUILD.gn b/services/test/moduletest/common/ams/ipc_app_scheduler_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/include/main_ability.h b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/include/main_ability.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/include/test_utils.h b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/include/test_utils.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/main_ability.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/test_utils.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/test_utils.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/include/main_ability.h b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/include/main_ability.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/include/second_ability.h b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/include/second_ability.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/include/test_utils.h b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/include/test_utils.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/main_ability.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/second_ability.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/test_utils.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/test_utils.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fourth_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fourth_ability.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/second_ability.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_main.h b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_main.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_second.h b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_second.h old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_main.cpp b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_main.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_second.cpp b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_second.cpp old mode 100755 new mode 100644 diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/test_utils.cpp b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/test_utils.cpp old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/BUILD.gn b/test/resource/formsystemtestability/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/include/form_ability_performance.h b/test/resource/formsystemtestability/fmsSystemPerformance/include/form_ability_performance.h old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/fmsSystemStress/include/form_ability_stress.h b/test/resource/formsystemtestability/fmsSystemStress/include/form_ability_stress.h old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/formSystemTestServiceA/include/form_st_service_ability_A.h b/test/resource/formsystemtestability/formSystemTestServiceA/include/form_st_service_ability_A.h old mode 100755 new mode 100644 diff --git a/test/resource/formsystemtestability/formSystemTestServiceA/src/form_st_service_ability_A.cpp b/test/resource/formsystemtestability/formSystemTestServiceA/src/form_st_service_ability_A.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_aa_command_test/BUILD.gn b/test/systemtest/common/ams/ams_aa_command_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_ability_append_test/BUILD.gn b/test/systemtest/common/ams/ams_ability_append_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_ability_state_age_manual_test/ams_ability_state_age_manual_test.cpp b/test/systemtest/common/ams/ams_ability_state_age_manual_test/ams_ability_state_age_manual_test.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_ability_state_test/ams_ability_state_test.cpp b/test/systemtest/common/ams/ams_ability_state_test/ams_ability_state_test.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_ability_visible_test/BUILD.gn b/test/systemtest/common/ams/ams_ability_visible_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_app_process_manage_test/BUILD.gn b/test/systemtest/common/ams/ams_app_process_manage_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_check_service/access_control_check.cpp b/test/systemtest/common/ams/ams_check_service/access_control_check.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_configuration_updated_test/BUILD.gn b/test/systemtest/common/ams/ams_configuration_updated_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_dfx_test/BUILD.gn b/test/systemtest/common/ams/ams_dfx_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_page_ability_test/BUILD.gn b/test/systemtest/common/ams/ams_page_ability_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_power_test/BUILD.gn b/test/systemtest/common/ams/ams_power_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/ams_service_ability_test/BUILD.gn b/test/systemtest/common/ams/ams_service_ability_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/ams/tool/BUILD.gn b/test/systemtest/common/ams/tool/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/BUILD.gn b/test/systemtest/common/fms/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/common/include/form_st_common_info.h b/test/systemtest/common/fms/common/include/form_st_common_info.h old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/common/src/system_test_form_util.cpp b/test/systemtest/common/fms/common/src/system_test_form_util.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/BUILD.gn b/test/systemtest/common/fms/fms_fuzz_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_config_parser.h old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h b/test/systemtest/common/fms/fms_fuzz_test/include/fuzz_test_manager.h old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/include/get_param.h b/test/systemtest/common/fms/fms_fuzz_test/include/get_param.h old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fuzz_test_manager.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/get_param.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_performance_test/BUILD.gn b/test/systemtest/common/fms/fms_performance_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_performance_test/fms_performance_test.cpp b/test/systemtest/common/fms/fms_performance_test/fms_performance_test.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_performance_test/performance_config_parser.h b/test/systemtest/common/fms/fms_performance_test/performance_config_parser.h old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_stress_test/BUILD.gn b/test/systemtest/common/fms/fms_stress_test/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_stress_test/fms_stress_test.cpp b/test/systemtest/common/fms/fms_stress_test/fms_stress_test.cpp old mode 100755 new mode 100644 diff --git a/test/systemtest/common/fms/fms_stress_test/stress_test_config_parser.h b/test/systemtest/common/fms/fms_stress_test/stress_test_config_parser.h old mode 100755 new mode 100644 diff --git a/tools/aa/src/ability_command.cpp b/tools/aa/src/ability_command.cpp index 35c645af..7c2bfd54 100644 --- a/tools/aa/src/ability_command.cpp +++ b/tools/aa/src/ability_command.cpp @@ -31,7 +31,7 @@ namespace OHOS { namespace AAFwk { namespace { const std::string SHORT_OPTIONS = "ch:d:a:b:p:s:CD"; -const struct option LONG_OPTIONS[] = { +constexpr struct option LONG_OPTIONS[] = { {"help", no_argument, nullptr, 'h'}, {"device", required_argument, nullptr, 'd'}, {"ability", required_argument, nullptr, 'a'}, @@ -43,13 +43,13 @@ const struct option LONG_OPTIONS[] = { {nullptr, 0, nullptr, 0}, }; const std::string SHORT_OPTIONS_ApplicationNotRespondin = "hp:"; -const struct option LONG_OPTIONS_ApplicationNotRespondin[] = { +constexpr struct option LONG_OPTIONS_ApplicationNotRespondin[] = { {"help", no_argument, nullptr, 'h'}, {"pid", required_argument, nullptr, 'p'}, {nullptr, 0, nullptr, 0}, }; const std::string SHORT_OPTIONS_DUMP = "has:m:lud::e::LS"; -const struct option LONG_OPTIONS_DUMP[] = { +constexpr struct option LONG_OPTIONS_DUMP[] = { {"help", no_argument, nullptr, 'h'}, {"all", no_argument, nullptr, 'a'}, {"stack", required_argument, nullptr, 's'}, @@ -63,7 +63,7 @@ const struct option LONG_OPTIONS_DUMP[] = { {nullptr, 0, nullptr, 0}, }; const std::string SHORT_OPTIONS_DUMPSYS = "hal::i:e::p::r::d::u:c"; -const struct option LONG_OPTIONS_DUMPSYS[] = { +constexpr struct option LONG_OPTIONS_DUMPSYS[] = { {"help", no_argument, nullptr, 'h'}, {"all", no_argument, nullptr, 'a'}, {"mission-list", no_argument, nullptr, 'l'}, diff --git a/tools/fm/BUILD.gn b/tools/fm/BUILD.gn old mode 100755 new mode 100644 diff --git a/tools/fm/include/fms_command.h b/tools/fm/include/fms_command.h old mode 100755 new mode 100644 diff --git a/tools/fm/src/fms_command.cpp b/tools/fm/src/fms_command.cpp old mode 100755 new mode 100644 diff --git a/tools/fm/src/main.cpp b/tools/fm/src/main.cpp old mode 100755 new mode 100644