PKG_CHECK_MODULES(DLOG_DEPS REQUIRED dlog)
PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
+PKG_CHECK_MODULES(AUL_DEPS REQUIRED aul)
PKG_CHECK_MODULES(BUNDLE_DEPS REQUIRED bundle)
PKG_CHECK_MODULES(PKGMGR_DEPS REQUIRED pkgmgr)
PKG_CHECK_MODULES(PKGMGR_PARSER_DEPS REQUIRED pkgmgr-parser)
# Dependency
APPLY_PKG_CONFIG(${TARGET_PKG_CLEARDATA} PUBLIC
+ AUL_DEPS
+ BUNDLE_DEPS
TZPLATFORM_DEPS
PKGMGR_DEPS
GLIB_DEPS
)
# Install
-INSTALL(TARGETS ${TARGET_PKG_CLEARDATA} DESTINATION bin)
\ No newline at end of file
+INSTALL(TARGETS ${TARGET_PKG_CLEARDATA} DESTINATION bin)
#include <sys/stat.h>
#include <sys/types.h>
+#include <aul.h>
+#include <bundle.h>
#include <dlog.h>
#include <tzplatform_config.h>
#include <pkgmgr-info.h>
static void __send_signal(const char *pkgid, const char *event_type,
const char *key, const char *val)
{
+ bundle *b;
+ uid_t pi_uid;
+
+ b = bundle_create();
+ bundle_add_str(b, AUL_K_PKGID, pkgid);
+ bundle_add_str(b, AUL_K_PACKAGETYPE, event_type);
+ bundle_add_str(b, AUL_K_PKG_EVENT_NAME, key);
+ bundle_add_str(b, AUL_K_PKG_EVENT_RESULT, val);
+
+ pi_uid = pkgmgr_installer_get_uid(pi);
+ aul_package_pre_event_send(pi_uid, b);
+ aul_package_pre_event_send(uid, b);
+ bundle_free(b);
+
pkgmgr_installer_send_signal(pi, event_type, pkgid, key, val);
pkgmgr_installer_send_signal_for_uid(pi, uid, event_type, pkgid, key,
val);
)
# Install
-INSTALL(TARGETS ${TARGET_PKG_GETSIZE} DESTINATION bin)
\ No newline at end of file
+INSTALL(TARGETS ${TARGET_PKG_GETSIZE} DESTINATION bin)
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mock/mock_hook.h"
+#include "mock/aul_mock.h"
+#include "mock/test_fixture.h"
+
+extern "C" int aul_package_event_pre_send(uid_t uid, bundle* b) {
+ return MOCK_HOOK_P2(AulMock, aul_package_event_pre_send, uid, b);
+}
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TESTS_MOCK_AUL_MOCK_H_
+#define TESTS_MOCK_AUL_MOCK_H_
+
+#include <tizen.h>
+#include <gmock/gmock.h>
+#include <aul.h>
+#include <bundle.h>
+
+#include "mock/module_mock.h"
+
+class AulMock : public virtual ModuleMock {
+ public:
+ AulMock() {
+ using ::testing::_;
+ using ::testing::Return;
+ using ::testing::Invoke;
+
+ ON_CALL(*this, aul_package_event_pre_send(_, _))
+ .WillByDefault(Return(0));
+ }
+ virtual ~AulMock() {}
+
+ MOCK_METHOD2(aul_package_event_pre_send, int(uid_t, bundle*));
+};
+
+#endif // TESTS_MOCK_AUL_MOCK_H_
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(pkgmgr-tool_unittests REQUIRED
+ aul
+ bundle
dlog
gmock
pkgmgr
#include "mock/os_mock.h"
#include "mock/pkgmgr_info_mock.h"
+#include "mock/aul_mock.h"
#include "mock/test_fixture.h"
#include "pkg_finder.hh"
#include "pkg_upgrader_factory.hh"