This api send signal to amd before sending pkg event to listeners.
amd should reload appinfo before some apps that is listening pkg event.
Change-Id: I82b4d8f8a8e5d1a93ee8d1e7aa13f81df34a077d
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
*/
int aul_unset_auto_restart();
+/**
+ * @remarks This function is only for App Framework internally.
+ */
+int aul_package_pre_event_send(uid_t uid, bundle *b);
+
#ifdef __cplusplus
}
#endif
BOOT_SEQUENCE_START_APP = 173,
BOOT_SEQUENCE_GET_APPINFO_LIST = 174,
BOOT_SEQUENCE_RELOAD = 175,
+
+ PKG_PRE_EVENT_SEND = 176,
+
APP_CMD_MAX
};
* @since_tizen 5.0
*/
#define AUL_K_COMPLICATION_MODE "__AUL_COMPLICATION_MODE__"
+
+/**
+ * @brief Definition for AUL: The package event name.
+ * @since_tizen 7.0
+ */
+#define AUL_K_PKG_EVENT_NAME "__AUL_K_PKG_EVENT_NAME__"
+
+/**
+ * @brief Definition for AUL: The package event
+ * @since_tizen 7.0
+ */
+#define AUL_K_PKG_EVENT_RESULT "__AUL_K_PKG_EVENT_RESULT__"
"BOOT_SEQUENCE_GET_APPINFO_LIST",
"BOOT_SEQUENCE_RELOAD",
+ "PKG_PRE_EVENT_SEND",
+
"CUSTOM_COMMAND"
};
#include <bundle_cpp.h>
#include <bundle_internal.h>
+#include <atomic>
#include <string>
#include <memory>
AUL_K_IS_SUBAPP,
};
+constexpr const char kPathAmdReady[] = "/run/.amd_ready";
+
+bool IsAmdReady() {
+ static std::atomic<bool> amd_ready = false;
+ if (amd_ready)
+ return amd_ready;
+
+ if (access(kPathAmdReady, F_OK) == 0) {
+ amd_ready.exchange(true);
+ return amd_ready;
+ }
+
+ return false;
+}
+
class Context {
public:
Context() = default;
return AUL_R_OK;
}
+
+extern "C" API int aul_package_pre_event_send(uid_t uid, bundle* b) {
+ if (b == nullptr) {
+ _E("Invalid paremeter");
+ return AUL_R_EINVAL;
+ }
+
+ if (!IsAmdReady())
+ return AUL_R_OK;
+
+ return AppRequest(PKG_PRE_EVENT_SEND, uid)
+ .With(b)
+ .SendSimply();
+}