starting alarm fix

Signed-off-by: liuyanzhi <liuyanzhi3@huawei.com>
Change-Id: Ia247f1e0b903414ad481ca4930af21fdffc7758f
This commit is contained in:
liuyanzhi
2021-12-14 18:51:08 +08:00
parent 0c374bde7d
commit fbd63d9dad
83 changed files with 166 additions and 156 deletions
@@ -214,7 +214,8 @@ public:
*
* @return Returns the number of data records updated.
*/
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);
/**
* @brief Deletes one or more data records from the database.
@@ -323,7 +324,8 @@ public:
*/
std::shared_ptr<AbilityPostEventTimeout> CreatePostEventTimeouter(std::string taskstr);
virtual std::vector<std::shared_ptr<DataAbilityResult>> ExecuteBatch(const std::vector<std::shared_ptr<DataAbilityOperation>> &operations);
virtual std::vector<std::shared_ptr<DataAbilityResult>> ExecuteBatch(
const std::vector<std::shared_ptr<DataAbilityOperation>> &operations);
protected:
/**
@@ -16,11 +16,11 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_ABILITY_LOADER_H
#define FOUNDATION_APPEXECFWK_OHOS_ABILITY_LOADER_H
#include "ability.h"
#include "ohos_application.h"
#include <functional>
#include <string>
#include <unordered_map>
#include "ability.h"
#include "ohos_application.h"
namespace OHOS {
namespace AppExecFwk {
@@ -17,7 +17,6 @@
#define FOUNDATION_APPEXECFWK_OHOS_ABILITY_POST_EVENT_TIMEOUT_H
#include <memory>
#include <atomic>
#include <mutex>
#include <string>
@@ -203,7 +203,8 @@ public:
*
* @return Returns the number of data records updated.
*/
int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates);
int Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates);
/**
* @brief Deletes one or more data records from the database.
@@ -354,7 +355,8 @@ public:
*/
bool CheckObsPermission();
std::vector<std::shared_ptr<DataAbilityResult>> ExecuteBatch(const std::vector<std::shared_ptr<DataAbilityOperation>> &operations);
std::vector<std::shared_ptr<DataAbilityResult>> ExecuteBatch(
const std::vector<std::shared_ptr<DataAbilityOperation>> &operations);
private:
/**
* @description: Create the abilityname.
@@ -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_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_DISTRIBUTED_CONTINUATION_HANDLER_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_DISTRIBUTED_CONTINUATION_HANDLER_H
#include <string>
@@ -77,4 +77,4 @@ private:
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_HANDLER_H
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_DISTRIBUTED_CONTINUATION_HANDLER_H
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_H
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_H
#include <string>
#include <mutex>
@@ -47,4 +47,4 @@ private:
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_H
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_H
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_INTERFACE_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_INTERFACE_H
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_INTERFACE_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_INTERFACE_H
#include <string>
@@ -41,4 +41,4 @@ public:
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_INTERFACE_H
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_INTERFACE_H
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_STUB_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_STUB_H
#ifndef FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_STUB_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_STUB_H
#include <string>
#include <map>
@@ -44,4 +44,4 @@ private:
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_KITS_ABILITY_NATIVE_INCLUDE_CONTINUATION_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_STUB_H
#endif // FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_CONTINUATION_SCHEDULE_FOR_DMS_STUB_H
@@ -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_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
#define FOUNDATION_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_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_AAFWK_STANDARD_FRAMEWORKS_ABILITY_INCLUDE_DISTRIBUTED_DISTRIBUTE_SCHEDULE_HANDLER_INTERFACE_H
@@ -16,9 +16,9 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_REMOTE_REGISTER_SERVICE_PROXY_H
#define FOUNDATION_APPEXECFWK_OHOS_REMOTE_REGISTER_SERVICE_PROXY_H
#include "remote_register_service_interface.h"
#include <iremote_object.h>
#include <map>
#include "remote_register_service_interface.h"
#include "message_parcel.h"
#include "iremote_proxy.h"
@@ -16,10 +16,10 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_REMOTE_REGISTER_SERVICE_STUB_H
#define FOUNDATION_APPEXECFWK_OHOS_REMOTE_REGISTER_SERVICE_STUB_H
#include "remote_register_service_interface.h"
#include <iremote_object.h>
#include <iremote_stub.h>
#include <map>
#include "remote_register_service_interface.h"
#include "message_parcel.h"
namespace OHOS {
@@ -304,7 +304,7 @@ private:
std::map<sptr<AAFwk::IDataAbilityObserver>, sptr<AAFwk::IAbilityScheduler>> registerMap_;
std::map<sptr<AAFwk::IDataAbilityObserver>, std::string> uriMap_;
std::map<sptr<AAFwk::IDataAbilityObserver>, std::string> uriMap_;
};
class DataAbilityDeathRecipient : public IRemoteObject::DeathRecipient {
@@ -164,9 +164,10 @@ 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
* implementation of this method returns null, indicating that this Data ability does not support URI normalization.
* 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 implementation of this method returns null, indicating that this Data ability does not support URI
* normalization.
*
* @param uri Indicates the Uri object to normalize.
*
@@ -180,9 +181,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 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);
@@ -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
@@ -16,9 +16,9 @@
#ifndef OHOS_AAFWK_IPCSINGLETON_H
#define OHOS_AAFWK_IPCSINGLETON_H
#include "nocopyable.h"
#include <mutex>
#include <memory>
#include "nocopyable.h"
namespace OHOS {
#define DECLARE_DELAYED_IPCSINGLETON(MyClass) \
@@ -14,8 +14,9 @@
*/
#include "ability_process.h"
#include "app_log_wrapper.h"
#include <dlfcn.h>
#include "app_log_wrapper.h"
namespace OHOS {
namespace AppExecFwk {
static void *g_handle = nullptr;
@@ -14,7 +14,6 @@
*/
#include "ability_thread.h"
#include <functional>
#include "ohos_application.h"
#include "ability_loader.h"
#include "ability_state.h"
@@ -409,7 +409,8 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in)
APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error");
return false;
}
APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s", empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL");
APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s",
empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL");
if (empty == VALUE_OBJECT) {
valuesBucket_.reset(in.ReadParcelable<NativeRdb::ValuesBucket>());
} else {
@@ -421,7 +422,8 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in)
APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error");
return false;
}
APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s", empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL");
APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s",
empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL");
if (empty == VALUE_OBJECT) {
dataAbilityPredicates_.reset(in.ReadParcelable<NativeRdb::DataAbilityPredicates>());
} else {
@@ -433,7 +435,8 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in)
APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error");
return false;
}
APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s", empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL");
APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s",
empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL");
if (empty == VALUE_OBJECT) {
valuesBucketReferences_.reset(in.ReadParcelable<NativeRdb::ValuesBucket>());
} else {
@@ -446,7 +449,8 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in)
return false;
}
if (referenceSize >= REFERENCE_THRESHOLD) {
APP_LOGI("DataAbilityOperation::ReadFromParcel referenceSize:%{public}d >= REFERENCE_THRESHOLD:%{public}d", referenceSize, REFERENCE_THRESHOLD);
APP_LOGI("DataAbilityOperation::ReadFromParcel referenceSize:%{public}d >= REFERENCE_THRESHOLD:%{public}d",
referenceSize, REFERENCE_THRESHOLD);
return true;
}
@@ -14,8 +14,6 @@
*/
#include "data_ability_result.h"
#include <string>
#include <memory>
#include "parcel_macro.h"
namespace OHOS {
@@ -13,8 +13,6 @@
* limitations under the License.
*/
#include "data_uri_utils.h"
#include <vector>
#include <memory>
#include <regex>
#include "securec.h"
@@ -16,9 +16,9 @@
#include "app_log_wrapper.h"
#include "form_constants.h"
#include "form_host_client.h"
#include "form_js_event_handler.h"
#include "form_mgr.h"
#include "ipc_skeleton.h"
#include "form_js_event_handler.h"
namespace OHOS {
namespace AppExecFwk {
@@ -15,7 +15,6 @@
#include <cinttypes>
#include "form_provider_client.h"
#include "appexecfwk_errors.h"
#include "app_log_wrapper.h"
#include "form_supply_proxy.h"
@@ -23,6 +22,7 @@
#include "permission/permission.h"
#include "permission/permission_kit.h"
#include "string_ex.h"
#include "form_provider_client.h"
namespace OHOS {
namespace AppExecFwk {
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "ability.h"
#include <gtest/gtest.h>
#include "ability.h"
#include "ability_loader.h"
#include "app_log_wrapper.h"
#include "iservice_registry.h"
@@ -216,7 +216,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;
@@ -16,9 +16,9 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_MOCK_INHERITANCE_IMPL_H
#define FOUNDATION_APPEXECFWK_OHOS_MOCK_INHERITANCE_IMPL_H
#include <gtest/gtest.h>
#include "ability.h"
#include "ability_impl.h"
#include <gtest/gtest.h>
namespace OHOS {
namespace AppExecFwk {
@@ -74,7 +74,7 @@ public:
return INSERTNUM;
};
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
const NativeRdb::DataAbilityPredicates &predicates)
{
return UPDATENUM;
};
@@ -184,7 +184,8 @@ bool MockAbilityManagerService::IsFirstInMission(const sptr<IRemoteObject> &toke
return true;
}
int MockAbilityManagerService::CompelVerifyPermission(const std::string &permission, int pid, int uid, std::string &message)
int MockAbilityManagerService::CompelVerifyPermission(const std::string &permission,
int pid, int uid, std::string &message)
{
return 0;
}
@@ -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_METHOD1(GetType, std::string(const Uri &));
MOCK_METHOD2(Reload, bool(const Uri &, const PacMap &));
MOCK_METHOD2(BatchInsert, int(const Uri &, const std::vector<NativeRdb::ValuesBucket> &));
@@ -54,9 +54,12 @@ public:
MOCK_METHOD1(NotifyTopActiveAbilityChanged, void(bool flag));
MOCK_METHOD2(NotifyMultiWinModeChanged, void(int32_t winModeKey, bool flag));
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_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));
};
} // namespace AppExecFwk
} // namespace OHOS
@@ -16,10 +16,10 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_MOCK_ABILITY_THREAD_H
#define FOUNDATION_APPEXECFWK_OHOS_MOCK_ABILITY_THREAD_H
#include <gtest/gtest.h>
#include "ability.h"
#include "ability_impl.h"
#include "ability_thread.h"
#include <gtest/gtest.h>
namespace OHOS {
namespace AppExecFwk {
@@ -393,7 +393,7 @@ public:
std::vector<FormInfo> &formInfo) override;
virtual bool QueryAbilityInfos(const Want &want, std::vector<AbilityInfo> &abilityInfos) override
{
return true;
return true;
};
virtual bool GetModuleUsageRecords(
const int32_t number, std::vector<ModuleUsageRecord> &moduleUsageRecords) override
@@ -16,8 +16,8 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_MOCK_DATA_ABILITY_H
#define FOUNDATION_APPEXECFWK_OHOS_MOCK_DATA_ABILITY_H
#include "ability.h"
#include <gtest/gtest.h>
#include "ability.h"
#include "abs_shared_result_set.h"
#include "data_ability_predicates.h"
@@ -87,7 +87,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;
}
@@ -13,11 +13,11 @@
* limitations under the License.
*/
#include <gtest/gtest.h>
#include "abs_shared_result_set.h"
#include "data_ability_predicates.h"
#include "values_bucket.h"
#include "data_ability_impl.h"
#include <gtest/gtest.h>
#include "app_log_wrapper.h"
const int returnValueOpenfile = 11;
@@ -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;
}
@@ -67,7 +67,6 @@ public:
*/
int AddForm(const int64_t formId, const Want &want, const sptr<IRemoteObject> &callerToken, FormJsInfo &formInfo)
{
// int64_t formId = want.GetLongParam(Constants::PARAM_FORM_IDENTITY_KEY, 0L);
if (formId == 300L) {
formInfo.formId = formId;
}
@@ -106,10 +105,10 @@ public:
*/
int UpdateForm(const int64_t formId, const std::string& bundleName, const FormProviderData& formBindingData)
{
if (formId == 300L) {
return -1;
}
return 0;
if (formId == 300L){
return -1;
}
return 0;
}
/**
@@ -16,9 +16,9 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_MOCK_LIFECYCLE_OBSERVER_INTERFACE_H
#define FOUNDATION_APPEXECFWK_OHOS_MOCK_LIFECYCLE_OBSERVER_INTERFACE_H
#include <gtest/gtest.h>
#include "want.h"
#include "ability_lifecycle_observer_interface.h"
#include <gtest/gtest.h>
namespace OHOS {
namespace AppExecFwk {
@@ -16,8 +16,8 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_MOCK_PAGE_ABILITY_H
#define FOUNDATION_APPEXECFWK_OHOS_MOCK_PAGE_ABILITY_H
#include "ability.h"
#include <gtest/gtest.h>
#include "ability.h"
namespace OHOS {
namespace AppExecFwk {
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "ability_impl.h"
#include <gtest/gtest.h>
#include "ability_impl.h"
#include "ability_local_record.h"
#include "app_log_wrapper.h"
@@ -175,7 +175,8 @@ int AbilityImpl::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value)
return 1;
}
int AbilityImpl::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AbilityImpl::Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
{
GTEST_LOG_(INFO) << "Mock AbilityImpl::Update called";
return 1;
@@ -18,10 +18,10 @@
#include "mock_resourceManager_interface1.h"
#include "res_config.h"
#include <string>
#include <vector>
#include <map>
#include "res_config.h"
namespace OHOS {
namespace Global {
@@ -265,7 +265,6 @@ public:
std::map<int, std::vector<int>> IntArrayById_;
std::map<int, uint32_t> ColorById_;
// static ResourceManagerTestInstance* instance;
static std::shared_ptr<ResourceManagerTestInstance> instance;
};
@@ -15,10 +15,10 @@
#ifndef OHOS_MOCK_RESOURCE_MANAGER_RESOURCEMANAGER1_H
#define OHOS_MOCK_RESOURCE_MANAGER_RESOURCEMANAGER1_H
#include "res_config.h"
#include <string>
#include <vector>
#include <map>
#include "res_config.h"
#include "resource_manager.h"
@@ -16,8 +16,8 @@
#ifndef FOUNDATION_APPEXECFWK_OHOS_MOCK_SERVICE_ABILITY_H
#define FOUNDATION_APPEXECFWK_OHOS_MOCK_SERVICE_ABILITY_H
#include "ability.h"
#include <gtest/gtest.h>
#include "ability.h"
namespace OHOS {
namespace AppExecFwk {
@@ -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";
@@ -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::_))
@@ -13,12 +13,12 @@
* limitations under the License.
*/
#include <gtest/gtest.h>
#include "abs_shared_result_set.h"
#include "data_ability_predicates.h"
#include "values_bucket.h"
#include "data_ability_operation.h"
#include "data_ability_operation_builder.h"
#include <gtest/gtest.h>
#include "parcel.h"
namespace OHOS {
@@ -115,7 +115,6 @@ HWTEST_F(DataAbilityResultTest, AppExecFwk_DataAbilityResult_DataAbilityResult02
*/
HWTEST_F(DataAbilityResultTest, AppExecFwk_DataAbilityResult_Get0100, Function | MediumTest | Level1)
{
// Uri uri("abc");
DataAbilityResult test(uri, SET_COUNT);
EXPECT_EQ(SET_COUNT, test.GetCount());
EXPECT_EQ(uri.ToString(), test.GetUri().ToString());
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "data_uri_utils.h"
#include <gtest/gtest.h>
#include "data_uri_utils.h"
#include "uri.h"
namespace OHOS {
@@ -26,7 +26,6 @@
#include "form_mgr.h"
#include "mock_form_mgr_service.h"
#include "mock_page_ability.h"
// #include "form_info.h"
#include "mock_bundle_manager_form.h"
namespace OHOS {
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "appexecfwk_errors.h"
#include <gtest/gtest.h>
#include "appexecfwk_errors.h"
#include "form_constants.h"
#include "form_provider_client.h"
#include "mock_form_supply_callback.h"
@@ -28,7 +28,6 @@
#include "ohos/aafwk/base/zchar_wrapper.h"
#include "string_ex.h"
#include <climits>
#include <securec.h>
#include "parcel.h"
@@ -192,7 +192,8 @@ bool MockServiceAbilityManagerService::IsFirstInMission(const sptr<IRemoteObject
return true;
}
int MockServiceAbilityManagerService::CompelVerifyPermission(const std::string &permission, int pid, int uid, std::string &message)
int MockServiceAbilityManagerService::CompelVerifyPermission(const std::string &permission,
int pid, int uid, std::string &message)
{
return 0;
}
@@ -13,14 +13,14 @@
* limitations under the License.
*/
#include "abs_shared_result_set.h"
#include "data_ability_predicates.h"
#include "values_bucket.h"
#include "demo_ability_test.h"
#include <future>
#include <gtest/gtest.h>
#include <iostream>
#include "abs_shared_result_set.h"
#include "data_ability_predicates.h"
#include "values_bucket.h"
#include "mock_lifecycle_observer.h"
#include "demo_ability_test.h"
using namespace std;
const int openfileValue = 123;
@@ -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;
}
@@ -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);
@@ -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;
}
@@ -21,13 +21,13 @@
#include "gtest/gtest.h"
#include <iostream>
#include "mock_ability_test.h"
#include "ohos_application.h"
#include "ability_thread.h"
#include "event_runner.h"
#include "ability_info.h"
#include "ability_local_record.h"
#include <iostream> //
namespace OHOS {
namespace AppExecFwk {
sptr<AppExecFwk::AbilityThread> MockCreateAbilityThread()
@@ -13,10 +13,10 @@
* limitations under the License.
*/
#include "gtest/gtest.h"
#include "abs_shared_result_set.h"
#include "data_ability_predicates.h"
#include "values_bucket.h"
#include "gtest/gtest.h"
#include "mock_ability_test.h"
#include "mock_ability_manager_client.h"
#include "mock_ability_thread_for_data_observer.h"
@@ -150,7 +150,8 @@ public:
*
* @return Returns the number of data records updated.
*/
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) = 0;
virtual int Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates) = 0;
/**
* @brief Deletes one or more data records from the database.
@@ -214,7 +215,7 @@ public:
*
* @return Return true if success. otherwise return false.
*/
virtual bool ScheduleRegisterObserver(const Uri &uri, const sptr<IDataAbilityObserver> &dataObserver) = 0;
virtual bool ScheduleRegisterObserver(const Uri &uri, const sptr<IDataAbilityObserver> &dataObserver) = 0;
/**
* @brief Deregisters an observer used for DataObsMgr specified by the given Uri.
@@ -16,9 +16,9 @@
#ifndef OHOS_AAFWK_IPCSINGLETON_H
#define OHOS_AAFWK_IPCSINGLETON_H
#include "nocopyable.h"
#include <mutex>
#include <memory>
#include "nocopyable.h"
namespace OHOS {
namespace AppExecFwk {
@@ -14,8 +14,8 @@
*/
#ifndef FOUNDATION_APPEXECFWK_OHOS_EXTRA_PARAMS_H
#define FOUNDATION_APPEXECFWK_OHOS_EXTRA_PARAMS_H
#include "parcel.h"
#include <string>
#include "parcel.h"
using string = std::string;
@@ -13,12 +13,12 @@
* limitations under the License.
*/
#include "napi_data_uri_utils.h"
#include "data_uri_utils.h"
#include "feature_ability_common.h"
#include "uri.h"
#include <cstring>
#include <vector>
#include <inttypes.h>
#include "data_uri_utils.h"
#include "feature_ability_common.h"
#include "uri.h"
#include "securec.h"
#include "hilog_wrapper.h"
@@ -15,13 +15,13 @@
#include <cstring>
#include <uv.h>
#include "securec.h"
#include "napi_context.h"
#include "hilog_wrapper.h"
#include "ability_process.h"
#include "feature_ability_common.h"
#include "../inner/napi_common/napi_common_ability.h"
#include "file_ex.h"
#include "directory_ex.h"
#include "napi_context.h"
using namespace OHOS::AAFwk;
using namespace OHOS::AppExecFwk;
@@ -12,13 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "napi_data_ability_helper.h"
#include "data_ability_observer_interface.h"
#include "data_ability_helper.h"
#include "uri.h"
#include <cstring>
#include <vector>
#include <uv.h>
#include "data_ability_observer_interface.h"
#include "data_ability_helper.h"
#include "uri.h"
#include "securec.h"
#include "hilog_wrapper.h"
#include "napi_result_set.h"
@@ -29,6 +28,7 @@
#include "napi_data_ability_operation.h"
#include "../inner/napi_common/napi_common_ability.h"
#include "message_parcel.h"
#include "napi_data_ability_helper.h"
using namespace OHOS::AAFwk;
using namespace OHOS::AppExecFwk;
@@ -1020,8 +1020,7 @@ void UnRegisterCompleteCB(napi_env env, napi_status status, void *data)
iter->observer->SetAssociatedObject(iter);
iter->observer->ChangeWorkInt();
HILOG_INFO("NAPI_UnRegister ReleaseJSCallback. 3 ---");
}
else {
} else {
iter->observer->ReleaseJSCallback();
delete iter;
iter = nullptr;
@@ -14,11 +14,11 @@
*/
#include <cstring>
#include "napi_common_util.h"
#include "napi_common_data.h"
#include "napi_common_error.h"
#include "hilog_wrapper.h"
#include "securec.h"
#include "napi_common_util.h"
namespace OHOS {
namespace AppExecFwk {
@@ -20,7 +20,6 @@
#include <unordered_set>
#include "ability_info.h"
// #include "app_process_data.h"
#include "appmgr/app_mgr_client.h"
#include "appmgr/app_state_callback_host.h"
#include "application_info.h"
@@ -19,9 +19,7 @@
#include <list>
#include <string>
#include <memory>
#include <mutex>
#include <condition_variable>
#include <chrono>
#include "ability_record.h"
#include "data_ability_caller_recipient.h"
@@ -16,8 +16,8 @@
#ifndef OHOS_AAFWK_WANT_RECEIVER_PROXY_H
#define OHOS_AAFWK_WANT_RECEIVER_PROXY_H
#include "want_receiver_interface.h"
#include <iremote_proxy.h>
#include "want_receiver_interface.h"
namespace OHOS {
namespace AAFwk {
@@ -16,8 +16,8 @@
#ifndef OHOS_AAFWK_WANT_SENDER_PROXY_H
#define OHOS_AAFWK_WANT_SENDER_PROXY_H
#include "want_sender_interface.h"
#include <iremote_proxy.h>
#include "want_sender_interface.h"
namespace OHOS {
namespace AAFwk {
@@ -369,7 +369,8 @@ int AbilitySchedulerProxy::Insert(const Uri &uri, const NativeRdb::ValuesBucket
*
* @return Returns the number of data records updated.
*/
int AbilitySchedulerProxy::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates)
int AbilitySchedulerProxy::Update(const Uri &uri, const NativeRdb::ValuesBucket &value,
const NativeRdb::DataAbilityPredicates &predicates)
{
int index = -1;
@@ -16,10 +16,10 @@
#ifndef OHOS_AAFWK_APPMGR_TEST_SERVICE_H
#define OHOS_AAFWK_APPMGR_TEST_SERVICE_H
#include <map>
#include "ability_manager_service.h"
#include "event_handler.h"
#include "event_runner.h"
#include <map>
namespace OHOS {
namespace AAFwk {
@@ -15,8 +15,6 @@
#include "appmgr_test_service.h"
#include <string>
#include <unistd.h>
#include "ability_scheduler.h"
#include "hilog_wrapper.h"
@@ -78,7 +78,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;
}
@@ -17,11 +17,11 @@
#define SERVICES_ABILITYMGR_TEST_MOCK_LIBS_ABILITY_SCHEDULER_MOCK_ABILITY_SCHEDULER_MOCK_H
#pragma once
#include "ability_scheduler_interface.h"
#include <iremote_object.h>
#include <iremote_stub.h>
#include "hilog_wrapper.h"
#include <gmock/gmock.h>
#include "ability_scheduler_interface.h"
#include "hilog_wrapper.h"
namespace OHOS {
namespace AAFwk {
@@ -21,7 +21,6 @@
#include "ability_info.h"
#include "application_info.h"
// #include "app_mgr_constants.h"
#include "iapp_state_callback.h"
#include "running_process_info.h"
@@ -15,9 +15,6 @@
#include "app_mgr_client.h"
#include <cstdio>
#include <string>
#include <unistd.h>
#include "if_system_ability_manager.h"
#include "ipc_skeleton.h"
@@ -59,7 +59,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;
}
@@ -24,8 +24,8 @@
#include "ability_manager_service.h"
#undef private
#undef protected
#include "ability_manager_errors.h"
#include "gtest/gtest.h"
#include "ability_manager_errors.h"
#include "mock_bundle_manager.h"
#include "want.h"
#include "sa_mgr_client.h"
@@ -400,7 +400,6 @@ HWTEST_F(KernalSystemAppManagerTest, OnTimeOut_001, TestSize.Level1)
};
EXPECT_NE(info.end(), std::find_if(info.begin(), info.end(), isFindAbilityInfo));
// remove form vector;
kernalSystemMgr_->OnTimeOut(AbilityManagerService::LOAD_TIMEOUT_MSG, topAbilityRecord->GetEventId());
info.clear();
@@ -15,17 +15,12 @@
#include "dataobs_mgr_service.h"
#include <functional>
#include <memory>
#include <string>
#include <unistd.h>
#include "string_ex.h"
#include "dataobs_mgr_errors.h"
#include "hilog_wrapper.h"
#include "if_system_ability_manager.h"
#include "ipc_skeleton.h"
// #include "sa_mgr_client.h"
#include "system_ability_definition.h"
namespace OHOS {
@@ -16,8 +16,8 @@
#ifndef MOCK_FOUNDATION_AAAFWK_INTERFACES_INNERKITS_ABILITY_CONNECT_CALLBACK_H
#define MOCK_FOUNDATION_AAAFWK_INTERFACES_INNERKITS_ABILITY_CONNECT_CALLBACK_H
#include "ability_connect_callback_interface.h"
#include "gtest/gtest.h"
#include "ability_connect_callback_interface.h"
#include "gmock/gmock.h"
namespace OHOS {
@@ -41,7 +41,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));
std::vector<std::string> GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter)
{
std::vector<std::string> types;
@@ -25,8 +25,8 @@
#include "ability_manager_service.h"
#undef private
#undef protected
#include "ability_manager_errors.h"
#include "gtest/gtest.h"
#include "ability_manager_errors.h"
#include "mock_bundle_mgr.h"
#include "want.h"
#include "sa_mgr_client.h"
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "gtest/gtest.h"
#include <unistd.h>
#include "gtest/gtest.h"
#include "mock_ability_connect_callback_stub.h"
#include "ability_connect_callback_proxy.h"
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "gtest/gtest.h"
#include <unistd.h>
#include "gtest/gtest.h"
#include "mock_ability_mgr_service.h"
#include "ability_manager_interface.h"
@@ -426,7 +426,8 @@ HWTEST_F(IpcAbilitySchedulerModuleTest, Update_001, TestSize.Level1)
NativeRdb::DataAbilityPredicates testPred;
int testRet = 123;
auto mockHandler = [&](const Uri &uri, const NativeRdb::ValuesBucket &vb, const NativeRdb::DataAbilityPredicates &pred) {
auto mockHandler = [&](const Uri &uri, const NativeRdb::ValuesBucket &vb,
const NativeRdb::DataAbilityPredicates &pred) {
testResult = true;
sem.Post();
return testRet;
@@ -504,7 +505,8 @@ HWTEST_F(IpcAbilitySchedulerModuleTest, Query_001, TestSize.Level1)
testColumns.emplace_back("col2");
NativeRdb::DataAbilityPredicates testPred;
auto mockHandler = [&](const Uri &uri, std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &pred) {
auto mockHandler = [&](const Uri &uri, std::vector<std::string> &columns,
const NativeRdb::DataAbilityPredicates &pred) {
testResult = (columns == testColumns);
sem.Post();
return std::make_shared<NativeRdb::AbsSharedResultSet>("DataAbilityTest");
@@ -541,7 +543,6 @@ HWTEST_F(IpcAbilitySchedulerModuleTest, ScheduleCommandAbility_001, TestSize.Lev
for (int i = 0; i < COUNT; i++) {
sptr<MockAbilitySchedulerStub> stub(new MockAbilitySchedulerStub());
sptr<AbilitySchedulerProxy> proxy(new AbilitySchedulerProxy(stub));
// sptr<IAbilityScheduler> proxy = iface_cast<IAbilityScheduler>(stub);
Want::ClearWant(&stubState.want);
auto stubHandler = [&](const Want &want, bool reStart, int startId) {
-2
View File
@@ -16,10 +16,8 @@
#define FOUNDATION_AAFWK_STANDARD_TOOLS_ZIP_H
#include <vector>
#include <functional>
#include <iostream>
#include <memory>
#include <time.h>
#include "zip_utils.h"
#include "file_path.h"
-2
View File
@@ -147,9 +147,7 @@ public:
// Returns true if there is at least one entry to read. This function is
// used to scan entries with AdvanceToNextEntry(), like:
//
// while (reader.HasMore()) {
// // Do something with the current file here.
// reader.AdvanceToNextEntry();
// }
bool HasMore();
-2
View File
@@ -411,7 +411,6 @@ napi_value UnwrapStringParam(std::string &str, napi_env env, napi_value argv)
HILOG_INFO("%{public}s,called", __func__);
// unwrap the param[0]
napi_valuetype valueType = napi_valuetype::napi_undefined;
// NAPI_CALL(env, napi_typeof(env, argv, &valueType));
napi_status rev = napi_typeof(env, argv, &valueType);
if (rev != napi_ok) {
return nullptr;
@@ -807,7 +806,6 @@ void ZipAndUnzipFileAsyncCallBackInnerJsThread(uv_work_t *work)
if (asyncCallbackInfo->isCallBack) {
napi_value callback = 0;
napi_value undefined = 0;
// callback(err, data) errorInfo->error_code;
result[PARAM0] = GetCallbackErrorValue(asyncCallbackInfo->env, NO_ERROR);
// get callback
napi_get_reference_value(asyncCallbackInfo->env, asyncCallbackInfo->callback, &callback);