fix charccter

Signed-off-by: liuyanzhi <liuyanzhi3@huawei.com>
Change-Id: Icc31ee046cab8a90a31522c61039403ac2718dd4
This commit is contained in:
liuyanzhi 2022-06-09 11:03:03 +08:00
parent 092858840d
commit 3c8b25022d
49 changed files with 198 additions and 152 deletions

View File

@ -93,9 +93,7 @@ bool RefBaseTestClass::gDestructorCalled_ = false;
CLASS(ObjectTestClass, 5afc4756 - 8f3c - 4d80 - a88b - 54521890beca)
{
public:
ObjectTestClass(
/* [in] */ int type)
: type_(type)
ObjectTestClass(int type) : type_(type)
{
gDestructorCalled_ = false;
}

View File

@ -524,7 +524,6 @@ void FormSysEventReceiver::HandleTimerUpdate(const int64_t formId,
// updateat to interval
type = TYPE_ATTIME_TO_INTERVAL;
} else {
// no change;
if (record.updateAtHour == timerCfg.updateAtHour && record.updateAtMin == timerCfg.updateAtMin) {
return;
}

View File

@ -429,7 +429,7 @@ NativeValue* JsAppManagerInit(NativeEngine* engine, NativeValue* exportObj)
std::make_unique<JsAppManager>(GetAppManagerInstance(), GetAbilityManagerInstance());
object->SetNativePointer(jsAppManager.release(), JsAppManager::Finalizer, nullptr);
//make handler
// make handler
handler_ = std::make_shared<AppExecFwk::EventHandler>(AppExecFwk::EventRunner::GetMainEventRunner());
HILOG_INFO("JsAppManagerInit BindNativeFunction called");

View File

@ -47,7 +47,8 @@ napi_value WrapConfiguration(napi_env env, const AppExecFwk::Configuration &conf
jsValue = WrapStringToJS(env, configuration.GetItem(AAFwk::GlobalConfigurationKey::SYSTEM_LANGUAGE));
SetPropertyValueByPropertyName(env, jsObject, "language", jsValue);
jsValue = WrapInt32ToJS(env, ConvertColorMode(configuration.GetItem(AAFwk::GlobalConfigurationKey::SYSTEM_COLORMODE)));
jsValue = WrapInt32ToJS(
env, ConvertColorMode(configuration.GetItem(AAFwk::GlobalConfigurationKey::SYSTEM_COLORMODE)));
SetPropertyValueByPropertyName(env, jsObject, "colorMode", jsValue);
int32_t displayId = ConvertDisplayId(configuration.GetItem(ConfigurationInner::APPLICATION_DISPLAYID));

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,8 +13,8 @@
* limitations under the License.
*/
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_H
#ifndef FOUNDATION_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_H
#define FOUNDATION_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_H
#include <string>
@ -78,4 +78,4 @@ private:
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_H
#endif // FOUNDATION_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_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
@ -13,8 +13,8 @@
* limitations under the License.
*/
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
#ifndef FOUNDATION_FRAMEWORKS_KITS_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
#define FOUNDATION_FRAMEWORKS_KITS_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
#include <string>
@ -48,4 +48,4 @@ public:
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
#endif // FOUNDATION_FRAMEWORKS_KITS_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_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
@ -177,8 +177,8 @@ public:
* @brief Converts the given uri that refer to the Data ability into a normalized URI. A normalized URI can be used
* across devices, persisted, backed up, and restored. It can refer to the same item in the Data ability even if the
* context has changed. If you implement URI normalization for a Data ability, you must also implement
* denormalizeUri(ohos.utils.net.Uri) to enable URI denormalization. After this feature is enabled, URIs passed to any
* method that is called on the Data ability must require normalization verification and denormalization. The default
* denormalizeUri(ohos.utils.net.Uri) to enable URI denormalization. After this feature enabled, URIs passed to any
* method that is called on Data ability must require normalization verification and denormalization. The default
* implementation of this method returns null, indicating that this Data ability does not support URI normalization.
*
* @param uri Indicates the Uri object to normalize.
@ -193,9 +193,9 @@ public:
*
* @param uri uri Indicates the Uri object to denormalize.
*
* @return Returns the denormalized Uri object if the denormalization is successful; returns the original Uri passed to
* this method if there is nothing to do; returns null if the data identified by the original Uri cannot be found in the
* current environment.
* @return Returns the denormalized Uri object if the denormalization is successful; returns the original Uri
* passed to this method if there is nothing to do; returns null if the data identified by the original Uri
* cannot be found in the current environment.
*/
Uri DenormalizeUri(const Uri &uri);

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
@ -53,7 +53,8 @@ public:
* operated by default.
* @return Returns an object containing the given filter criteria.
*/
std::shared_ptr<DataAbilityOperationBuilder> WithPredicates(std::shared_ptr<NativeRdb::DataAbilityPredicates> &predicates);
std::shared_ptr<DataAbilityOperationBuilder> WithPredicates(
std::shared_ptr<NativeRdb::DataAbilityPredicates> &predicates);
/**
* @brief Sets the expected number of rows to update ,delete or assert query.
* @param count Indicates the expected number of rows to update or delete.
@ -76,7 +77,8 @@ public:
* replace the specified value. This parameter cannot be null.
* @return Returns a DataAbilityOperationBuilder object containing the given backReferences parameter.
*/
std::shared_ptr<DataAbilityOperationBuilder> WithValueBackReferences(std::shared_ptr<NativeRdb::ValuesBucket> &backReferences);
std::shared_ptr<DataAbilityOperationBuilder> WithValueBackReferences(
std::shared_ptr<NativeRdb::ValuesBucket> &backReferences);
/**
* @brief Sets an interrupt flag bit for a batch operation, which can be insert, update, delete, or assert.
* @param interrupted Specifies whether a batch operation can be interrupted. The value true indicates that the

View File

@ -500,8 +500,8 @@ NativeValue* JsAbilityContext::OnStartExtensionAbility(NativeEngine& engine, Nat
[weak = context_, want, argErrorCode](NativeEngine& engine, AsyncTask& task, int32_t status) {
auto context = weak.lock();
if (argErrorCode != 0) {
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
}
if (!context) {
HILOG_WARN("context is released");
@ -548,8 +548,8 @@ NativeValue* JsAbilityContext::OnStartExtensionAbilityWithAccount(NativeEngine&
[weak = context_, want, accountId, argErrorCode](NativeEngine& engine, AsyncTask& task, int32_t status) {
auto context = weak.lock();
if (argErrorCode != 0) {
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
}
if (!context) {
HILOG_WARN("context is released");
@ -589,8 +589,8 @@ NativeValue* JsAbilityContext::OnStopExtensionAbility(NativeEngine& engine, Nati
[weak = context_, want, argErrorCode](NativeEngine& engine, AsyncTask& task, int32_t status) {
auto context = weak.lock();
if (argErrorCode != 0) {
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
}
if (!context) {
HILOG_WARN("context is released");
@ -636,8 +636,8 @@ NativeValue* JsAbilityContext::OnStopExtensionAbilityWithAccount(NativeEngine& e
[weak = context_, want, accountId, argErrorCode](NativeEngine& engine, AsyncTask& task, int32_t status) {
auto context = weak.lock();
if (argErrorCode != 0) {
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
task.Reject(engine, CreateJsError(engine, argErrorCode, "Invalid params."));
return;
}
if (!context) {
HILOG_WARN("context is released");

View File

@ -123,7 +123,8 @@ std::shared_ptr<RawFileDescriptor> Ability::OpenRawFile(const Uri &uri, const st
return nullptr;
}
int Ability::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int Ability::Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "Mock Ability::Update called";
return 1;

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
@ -72,7 +72,8 @@ public:
{
return INSERTNUM;
};
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
virtual int Update(
const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
return UPDATENUM;
};

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
@ -44,8 +44,8 @@ public:
MOCK_METHOD2(Insert, int(const Uri &, const NativeRdb::ValuesBucket &));
MOCK_METHOD3(Update, int(const Uri &, const NativeRdb::ValuesBucket &, const NativeRdb::DataAbilityPredicates &));
MOCK_METHOD2(Delete, int(const Uri &, const NativeRdb::DataAbilityPredicates &));
MOCK_METHOD3(
Query, std::shared_ptr<NativeRdb::AbsSharedResultSet>(const Uri &, std::vector<std::string> &, const NativeRdb::DataAbilityPredicates &));
MOCK_METHOD3(Query, std::shared_ptr<NativeRdb::AbsSharedResultSet>(const Uri &,
std::vector<std::string> &, const NativeRdb::DataAbilityPredicates &));
MOCK_METHOD4(Call, std::shared_ptr<PacMap>(const Uri &, const std::string &, const std::string &, const PacMap &));
MOCK_METHOD1(GetType, std::string(const Uri &));
MOCK_METHOD2(Reload, bool(const Uri &, const PacMap &));
@ -55,7 +55,8 @@ public:
MOCK_METHOD2(ScheduleRegisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver));
MOCK_METHOD2(ScheduleUnregisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver));
MOCK_METHOD1(ScheduleNotifyChange, bool(const Uri &uri));
MOCK_METHOD1(ExecuteBatch, std::vector<std::shared_ptr<AppExecFwk::DataAbilityResult>>(const std::vector<std::shared_ptr<AppExecFwk::DataAbilityOperation>> &operation));
MOCK_METHOD1(ExecuteBatch, std::vector<std::shared_ptr<AppExecFwk::DataAbilityResult>>(
const std::vector<std::shared_ptr<AppExecFwk::DataAbilityOperation>> &operation));
MOCK_METHOD1(NotifyContinuationResult, void(int32_t result));
MOCK_METHOD2(ContinueAbility, void(const std::string& deviceId, uint32_t versionCode));
MOCK_METHOD2(DumpAbilityInfo, void(const std::vector<std::string> &params, std::vector<std::string> &info));

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
@ -48,7 +48,8 @@ public:
return 1;
}
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "MockDataAbility::Update called";
@ -87,7 +88,8 @@ public:
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "MockDataAbility::Query called";
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>("QueryTest");
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>(
"QueryTest");
return set;
}

View File

@ -54,7 +54,8 @@ int DataAbilityImpl::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value
return returnValueInsert;
}
int DataAbilityImpl::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int DataAbilityImpl::Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "Mock DataAbilityImpl::Update called";
return returnValueUpdate;
@ -70,7 +71,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> DataAbilityImpl::Query(
const Uri &uri, std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "Mock DataAbilityImpl::Query called";
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultSet = std::make_shared<NativeRdb::AbsSharedResultSet>(std::string("Test"));
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultSet = std::make_shared<NativeRdb::AbsSharedResultSet>(
std::string("Test"));
return resultSet;
}

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
@ -74,7 +74,8 @@ HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_GetState_0
* @tc.desc: Test whether attachbasecontext is called normally,
* and verify whether the return value of getdatabasedir is ACTIVE.
*/
HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0100, Function | MediumTest | Level1)
HWTEST_F(AbilityLifecycleExecutorTest,
AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0100, Function | MediumTest | Level1)
{
GTEST_LOG_(INFO) << "AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0100 start";
@ -93,7 +94,8 @@ HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLi
* @tc.desc: Test whether attachbasecontext is called normally,
* and verify whether the return value of getdatabasedir is BACKGROUND.
*/
HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0200, Function | MediumTest | Level1)
HWTEST_F(AbilityLifecycleExecutorTest,
AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0200, Function | MediumTest | Level1)
{
GTEST_LOG_(INFO) << "AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0200 start";
@ -112,7 +114,8 @@ HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLi
* @tc.desc: Test whether attachbasecontext is called normally,
* and verify whether the return value of getdatabasedir is INACTIVE.
*/
HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0300, Function | MediumTest | Level1)
HWTEST_F(AbilityLifecycleExecutorTest,
AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0300, Function | MediumTest | Level1)
{
GTEST_LOG_(INFO) << "AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0300 start";
@ -131,7 +134,8 @@ HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLi
* @tc.desc: Test whether attachbasecontext is called normally,
* and verify whether the return value of getdatabasedir is INITIAL.
*/
HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0400, Function | MediumTest | Level1)
HWTEST_F(AbilityLifecycleExecutorTest,
AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0400, Function | MediumTest | Level1)
{
GTEST_LOG_(INFO) << "AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0400 start";
@ -150,7 +154,8 @@ HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLi
* @tc.desc: Test whether attachbasecontext is called normally,
* and verify whether the return value of getdatabasedir is UNINITIALIZED.
*/
HWTEST_F(AbilityLifecycleExecutorTest, AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0500, Function | MediumTest | Level1)
HWTEST_F(AbilityLifecycleExecutorTest,
AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0500, Function | MediumTest | Level1)
{
GTEST_LOG_(INFO) << "AaFwk_AbilityLifecycleExecutor_DispatchLifecycleState_0500 start";

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
@ -266,7 +266,8 @@ HWTEST_F(DataAbilityHelperForObserverTest, AaFwk_DataAbilityHelper_Update_0100,
val.PutInt("valtest", 20);
NativeRdb::DataAbilityPredicates predicates("predicatestest");
// Test to AbilityThread interface
auto returnUpdate = [&](const Uri &uri, const NativeRdb::ValuesBucket &val, const NativeRdb::DataAbilityPredicates &predicates) {
auto returnUpdate = [&](
const Uri &uri, const NativeRdb::ValuesBucket &val, const NativeRdb::DataAbilityPredicates &predicates) {
int index = 1234;
return index;
};
@ -298,7 +299,8 @@ HWTEST_F(DataAbilityHelperForObserverTest, AaFwk_DataAbilityHelper_Update_0200,
val.PutInt("valtest", 20);
NativeRdb::DataAbilityPredicates predicates("predicatestest");
// Test to AbilityThread interface
auto returnUpdate = [&](const Uri &uri, const NativeRdb::ValuesBucket &val, const NativeRdb::DataAbilityPredicates &predicates) {
auto returnUpdate = [&](
const Uri &uri, const NativeRdb::ValuesBucket &val, const NativeRdb::DataAbilityPredicates &predicates) {
int index = 1234;
return index;
};
@ -390,8 +392,10 @@ HWTEST_F(DataAbilityHelperForObserverTest, AaFwk_DataAbilityHelper_Query_0100, F
NativeRdb::DataAbilityPredicates predicates("predicatestest");
// Test to AbilityThread interface
auto returnQuery =
[&](const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) {
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>("resultset");
[&](const Uri &uri, const std::vector<std::string> &columns,
const NativeRdb::DataAbilityPredicates &predicates) {
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>(
"resultset");
return set;
};
EXPECT_CALL(*mockTools->GetMockAbilityScheduler(), Query(testing::_, testing::_, testing::_))
@ -422,8 +426,10 @@ HWTEST_F(DataAbilityHelperForObserverTest, AaFwk_DataAbilityHelper_Query_0200, F
NativeRdb::DataAbilityPredicates predicates("predicatestest");
// Test to AbilityThread interface
auto returnQuery =
[&](const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) {
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>("resultset");
[&](const Uri &uri, const std::vector<std::string> &columns,
const NativeRdb::DataAbilityPredicates &predicates) {
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>(
"resultset");
return set;
};
EXPECT_CALL(*mockTools->GetMockAbilityScheduler(), Query(testing::_, testing::_, testing::_))

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
@ -61,6 +61,9 @@ public:
keepContext_ = context;
}
protected:
std::weak_ptr<Context> context_;
private:
NativeValue* OnCreateBundleContext(NativeEngine& engine, NativeCallbackInfo& info);
NativeValue* OnGetApplicationContext(NativeEngine& engine, NativeCallbackInfo& info);
@ -69,9 +72,6 @@ private:
NativeValue* OnCreateModuleContext(NativeEngine& engine, NativeCallbackInfo& info);
std::shared_ptr<Context> keepContext_;
protected:
std::weak_ptr<Context> context_;
};
void JsBaseContext::Finalizer(NativeEngine* engine, void* data, void* hint)

View File

@ -563,7 +563,7 @@ std::shared_ptr<Context> ContextContainer::CreateBundleContext(std::string bundl
}
sptr<IBundleMgr> bundleMgr = GetBundleManager();
if (nullptr == bundleMgr) {
if (bundleMgr == nullptr) {
HILOG_ERROR("ContextContainer::CreateBundleContext GetBundleManager is nullptr");
return nullptr;
}

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
@ -99,12 +99,12 @@ void MockApplication::OnStart()
EXPECT_STREQ("/hos/lib/dataDir", GetApplicationContext()->GetDir("test", 1).c_str());
std::vector<std::string> state;
EXPECT_NE(nullptr, GetAbilityManager());
if (nullptr != GetAbilityManager()) {
if (GetAbilityManager() != nullptr) {
GetAbilityManager()->DumpState("test", state);
}
EXPECT_NE(nullptr, GetBundleManager());
if (nullptr != GetBundleManager()) {
if (GetBundleManager() != nullptr) {
EXPECT_STREQ("ModuleTestType", GetBundleManager()->GetAppType("test").c_str());
}
} else if (INMOCKAPPLICATION_ONE == GetProcessInfo()->GetPid()) {

View File

@ -163,7 +163,8 @@ int DemoAbility::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value)
return insertValue;
}
int DemoAbility::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int DemoAbility::Update(
const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "DemoAbility::Update called";
return updateValue;
@ -198,7 +199,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> DemoAbility::Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "DemoAbility::Query called";
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultset = std::make_shared<NativeRdb::AbsSharedResultSet>("resultset");
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultset = std::make_shared<NativeRdb::AbsSharedResultSet>(
"resultset");
return resultset;
}

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,8 @@ protected:
virtual int OpenFile(const Uri &uri, const std::string &mode);
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates);
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value);
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates);
virtual int Update(
const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates);
virtual int OpenRawFile(const Uri &uri, const std::string &mode);
virtual bool Reload(const Uri &uri, const PacMap &extras);
virtual int BatchInsert(const Uri &uri, const std::vector<NativeRdb::ValuesBucket> &values);

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
@ -111,7 +111,8 @@ public:
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "MockDataAbility::Query called";
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>("QueryTest");
std::shared_ptr<NativeRdb::AbsSharedResultSet> set = std::make_shared<NativeRdb::AbsSharedResultSet>(
"QueryTest");
return set;
}

View File

@ -53,7 +53,8 @@ ApplicationStateObserverStub::~ApplicationStateObserverStub()
int ApplicationStateObserverStub::OnRemoteRequest(
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
{
HILOG_INFO("ApplicationStateObserverStub::OnReceived, code = %{public}u, flags= %{public}d.", code, option.GetFlags());
HILOG_INFO("ApplicationStateObserverStub::OnReceived, code = %{public}u, flags= %{public}d.",
code, option.GetFlags());
std::u16string descriptor = ApplicationStateObserverStub::GetDescriptor();
std::u16string remoteDescriptor = data.ReadInterfaceToken();
if (descriptor != remoteDescriptor) {

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
@ -75,7 +75,8 @@ int AbilityScheduler::Insert(const Uri &uri, const NativeRdb::ValuesBucket &valu
return -1;
}
int AbilityScheduler::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AbilityScheduler::Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
{
return -1;
}

View File

@ -57,7 +57,8 @@ public:
return -1;
}
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override
{
return -1;
}

View File

@ -474,7 +474,8 @@ public:
* @param ability, ability or extension record.
* @param state, ability or extension state.
*/
void StateChangedNotifyObserver(const std::shared_ptr<AbilityRunningRecord> &ability, int32_t state, bool isAbility);
void StateChangedNotifyObserver(
const std::shared_ptr<AbilityRunningRecord> &ability, int32_t state, bool isAbility);
void insertAbilityStageInfo(std::vector<HapModuleInfo> moduleInfos);

View File

@ -107,7 +107,6 @@ private:
AppLaunchData launchData_;
AbilityInfo abilityInfo_;
Profile profile_;
// Configuration configuration_;
};
} // namespace AppExecFwk
} // 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
@ -38,7 +38,8 @@ public:
MOCK_METHOD2(
ScheduleUnregisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver));
MOCK_METHOD1(ScheduleNotifyChange, bool(const Uri &uri));
MOCK_METHOD1(ExecuteBatch, std::vector<std::shared_ptr<AppExecFwk::DataAbilityResult>>(const std::vector<std::shared_ptr<AppExecFwk::DataAbilityOperation>> &operations));
MOCK_METHOD1(ExecuteBatch, std::vector<std::shared_ptr<AppExecFwk::DataAbilityResult>>(
const std::vector<std::shared_ptr<AppExecFwk::DataAbilityOperation>> &operations));
MOCK_METHOD1(NotifyContinuationResult, void(int32_t result));
MOCK_METHOD2(ContinueAbility, void(const std::string& deviceId, uint32_t versionCode));
MOCK_METHOD2(DumpAbilityInfo, void(const std::vector<std::string> &params, std::vector<std::string> &info));

View File

@ -61,8 +61,6 @@ public:
};
class PendingWantCallback : public CompletedCallback {
private:
/* data */
public:
PendingWantCallback() = default;
~PendingWantCallback() = default;

View File

@ -63,8 +63,6 @@ public:
};
class PendingWantCallback : public CompletedCallback {
private:
/* data */
public:
PendingWantCallback() = default;
~PendingWantCallback() = default;

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
@ -46,9 +46,10 @@ protected:
virtual void OnStart(const Want &want) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

View File

@ -126,7 +126,8 @@ int AmsStDataAbilityDataA::Delete(const Uri &uri, const NativeRdb::DataAbilityPr
return DEFAULT_DELETE_RESULT;
}
int AmsStDataAbilityDataA::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AmsStDataAbilityDataA::Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
{
HILOG_INFO("AmsStDataAbilityDataA <<<<Update>>>>");
PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, "Update");
@ -143,7 +144,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStDataAbilityDataA::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_A_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue =
std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
if (resultValue == nullptr) {
HILOG_ERROR("AmsStDataAbilityDataA <<<<Query>>>> make_shared return nullptr");
return nullptr;

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
@ -43,9 +43,10 @@ protected:
virtual void OnStart(const Want &want) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

View File

@ -107,7 +107,8 @@ int AmsStDataAbilityDataB::Delete(const Uri &uri, const NativeRdb::DataAbilityPr
return DEFAULT_DELETE_RESULT;
}
int AmsStDataAbilityDataB::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AmsStDataAbilityDataB::Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
HILOG_INFO("AmsStDataAbilityDataB <<<<Update>>>>");
PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, "Update");
@ -124,7 +125,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStDataAbilityDataB::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_B_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue =
std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);

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
@ -45,9 +45,10 @@ protected:
virtual void OnStart(const Want &want) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;
friend class DataTestDataC1EventSubscriber;

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
@ -44,9 +44,10 @@ protected:
virtual void OnStart(const Want &want) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

View File

@ -120,7 +120,8 @@ int AmsStDataAbilityDataC1::Delete(const Uri &uri, const NativeRdb::DataAbilityP
return DEFAULT_DELETE_RESULT;
}
int AmsStDataAbilityDataC1::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AmsStDataAbilityDataC1::Update(
const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
HILOG_INFO("AmsStDataAbilityDataC1 <<<<Update>>>>");
PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, "Update");
@ -137,7 +138,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStDataAbilityDataC1::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_C1_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(
OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);
@ -229,7 +231,8 @@ void DataTestDataC1EventSubscriber::GetResultBySelf(
HILOG_INFO("---------------------Query--------------------");
std::vector<std::string> columns = STtools::SerializationStOperatorToVector(*child);
NativeRdb::DataAbilityPredicates predicates;
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = mainAbility->Query(dataAbilityUri, columns, predicates);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = mainAbility->Query(
dataAbilityUri, columns, predicates);
result = "failed";
if (resultValue != nullptr) {
resultValue->GoToRow(0);

View File

@ -107,7 +107,8 @@ int AmsStDataAbilityDataC2::Delete(const Uri &uri, const NativeRdb::DataAbilityP
return DEFAULT_DELETE_RESULT;
}
int AmsStDataAbilityDataC2::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AmsStDataAbilityDataC2::Update(
const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
HILOG_INFO("AmsStDataAbilityDataC2 <<<<Update>>>>");
PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, "Update");
@ -124,7 +125,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStDataAbilityDataC2::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_C2_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(
OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);

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
@ -58,9 +58,10 @@ protected:
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

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
@ -58,9 +58,10 @@ protected:
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

View File

@ -58,9 +58,10 @@ protected:
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

View File

@ -298,7 +298,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStKitDataAbilityDataA1::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue =
std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);

View File

@ -295,7 +295,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStKitDataAbilityDataA2::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue =
std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);

View File

@ -298,7 +298,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStKitDataAbilityDataA3::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue =
std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);

View File

@ -57,9 +57,10 @@ protected:
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
virtual int Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) override;
virtual int Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual int Update(const Uri &uri,
const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::shared_ptr<NativeRdb::AbsSharedResultSet> Query(const Uri &uri,
const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates) override;
virtual std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override;
virtual int OpenFile(const Uri &uri, const std::string &mode) override;

View File

@ -278,7 +278,8 @@ int AmsStKitDataAbilityDataB::Delete(const Uri &uri, const NativeRdb::DataAbilit
return DEFAULT_DELETE_RESULT;
}
int AmsStKitDataAbilityDataB::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AmsStKitDataAbilityDataB::Update(
const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
{
HILOG_INFO("AmsStKitDataAbilityDataB <<<<Update>>>>");
PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Update");
@ -295,7 +296,8 @@ std::shared_ptr<NativeRdb::AbsSharedResultSet> AmsStKitDataAbilityDataB::Query(
STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE);
subscriber_->TestPost();
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(OPERATOR_QUERY);
std::shared_ptr<NativeRdb::AbsSharedResultSet> resultValue = std::make_shared<NativeRdb::AbsSharedResultSet>(
OPERATOR_QUERY);
AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock();
if (pSharedBlock) {
pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1);

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
@ -25,17 +25,6 @@ class StOperator;
std::vector<string> SerializationStOperatorToVector(StOperator &ParentOperator);
void DeserializationStOperatorFromVector(StOperator &ParentOperator, std::vector<string> &vectorOperator);
class StOperator {
private:
std::vector<std::shared_ptr<StOperator>> g_childOperator;
std::shared_ptr<StOperator> g_parentOperator;
string g_abilityType;
string g_bundleName;
string g_abilityName;
string g_operatorName; // data ability
string g_message;
/* data */
static int countChild;
public:
StOperator();
StOperator(const string &type, const string &bundle, const string &ability, const string &operatorName = "",
@ -55,6 +44,17 @@ public:
StOperator &AddChildOperator(std::shared_ptr<StOperator> childOperator);
std::vector<std::shared_ptr<StOperator>> GetChildOperator();
std::vector<std::shared_ptr<StOperator>> PopChildOperator();
private:
std::vector<std::shared_ptr<StOperator>> g_childOperator;
std::shared_ptr<StOperator> g_parentOperator;
string g_abilityType;
string g_bundleName;
string g_abilityName;
string g_operatorName; // data ability
string g_message;
/* data */
static int countChild;
};
} // namespace STtools
#endif // _ABILITY_MANAGER_SERVICE_ST_OPERATOR_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
@ -25,17 +25,6 @@ namespace STtools {
using std::string;
class StOperator {
private:
std::vector<std::shared_ptr<StOperator>> g_childOperator;
std::shared_ptr<StOperator> g_parentOperator;
string g_abilityType;
string g_bundleName;
string g_abilityName;
string g_operatorName; // data ability
string g_message;
/* data */
static int countChild;
public:
StOperator();
StOperator(const string &type, const string &bundle, const string &ability, const string &operatorName = "",
@ -54,6 +43,17 @@ public:
StOperator &SetMessage(const string &message);
StOperator &AddChildOperator(std::shared_ptr<StOperator> childOperator);
std::vector<std::shared_ptr<StOperator>> GetChildOperator();
private:
std::vector<std::shared_ptr<StOperator>> g_childOperator;
std::shared_ptr<StOperator> g_parentOperator;
string g_abilityType;
string g_bundleName;
string g_abilityName;
string g_operatorName; // data ability
string g_message;
/* data */
static int countChild;
};
} // namespace STtools
} // namespace OHOS

View File

@ -215,7 +215,8 @@ int32_t FormMgrShellCommand::HandleUnknownOption(const char optopt)
* @param cmdFlag Command Flag.
* @return Returns ERR_OK on success, others on failure.
*/
int32_t FormMgrShellCommand::HandleNormalOption(const int option, std::string &bundleName, int64_t &formId, int32_t &cmdFlag)
int32_t FormMgrShellCommand::HandleNormalOption(
const int option, std::string &bundleName, int64_t &formId, int32_t &cmdFlag)
{
HILOG_INFO("%{public}s start, option: %{public}d", __func__, option);
int32_t result = OHOS::ERR_OK;
@ -279,7 +280,8 @@ int32_t FormMgrShellCommand::HandleNormalOption(const int option, std::string &b
*/
int32_t FormMgrShellCommand::ExecuteQuery(const std::string &bundleName, const int64_t formId, const int32_t cmdFlag)
{
HILOG_INFO("%{public}s start, bundleName: %{public}s, formId:%{public}" PRId64 "", __func__, bundleName.c_str(), formId);
HILOG_INFO("%{public}s start, bundleName: %{public}s, formId:%{public}" PRId64 "", __func__,
bundleName.c_str(), formId);
int32_t result = OHOS::ERR_OK;
switch (cmdFlag) {
case COMMAND_QUERY_STORAGE: {