AUX_SOURCE_DIRECTORY(aul/common AUL_COMMON_SRCS)
AUX_SOURCE_DIRECTORY(aul/component AUL_COMPONENT_SRCS)
AUX_SOURCE_DIRECTORY(aul/socket AUL_SOCKET_SRCS)
-AUX_SOURCE_DIRECTORY(aul/boot_sequence AUL_BOOT_SEQUENCE_SRCS)
ADD_LIBRARY(${TARGET_AUL} SHARED
${SRCS}
*/
#define AUL_K_RESTART_EXTRA "__AUL_RESTART_EXTRA__"
-#define AUL_K_SUB_STATUS "__AUL_SUB_STATUS__"
-
-#define AUL_K_BOOT_SEQUENCE_CMD "__AUL_BOOT_SEQUENCE_CMD__"
+/**
+ * @brief Definition for AUL: The priority of boot sequence app.
+ * @since_tizen 7.0
+ */
+#define AUL_K_BOOT_SEQUENCE_PRIORITY "__AUL_BOOT_SEQUENCE_PRIORITY__"
-#define AUL_K_BOOT_SEQUENCE_LOGS "__AUL_BOOT_SEQUENCE_LOGS__"
+/**
+ * @brief Definition for AUL: The flag of boot sequence app's reqdy wait.
+ * @since_tizen 7.0
+ */
+#define AUL_K_BOOT_SEQUENCE_READY_WAIT "__AUL_BOOT_SEQUENCE_READY_WAIT__"
-#define AUL_K_BOOT_SEQUENCE_PRIORITY "__AUL_BOOT_SEQUENCE_PRIORITY__"
+/**
+ * @brief Definition for AUL: The sub status of app.
+ * @since_tizen 7.0
+ */
+#define AUL_K_SUB_STATUS "__AUL_SUB_STATUS__"
+/**
+ * @brief Definition for AUL: The appid list of boot sequence app's after dependency.
+ * @since_tizen 7.0
+ */
#define AUL_K_BOOT_SEQUENCE_AFTER "__AUL_BOOT_SEQUENCE_AFTER__"
+/**
+ * @brief Definition for AUL: The appid list of boot sequence app's before dependency.
+ * @since_tizen 7.0
+ */
#define AUL_K_BOOT_SEQUENCE_BEFORE "__AUL_BOOT_SEQUENCE_BEFORE__"
+/**
+ * @brief Definition for AUL: The appid list of boot sequence app's requires dependency.
+ * @since_tizen 7.0
+ */
#define AUL_K_BOOT_SEQUENCE_REQUIRES "__AUL_BOOT_SEQUENCE_REQUIRES__"
+/**
+ * @brief Definition for AUL: The appid list of boot sequence app's conflicts dependency.
+ * @since_tizen 7.0
+ */
#define AUL_K_BOOT_SEQUENCE_CONFLICTS "__AUL_BOOT_SEQUENCE_CONFLICTS__"
+/**
+ * @brief Definition for AUL: The args bundle data.
+ * @since_tizen 7.0
+ */
#define AUL_K_ARGS "__AUL_ARGS__"
-#define AUL_K_BOOT_SEQUENCE_READY_WAIT "__AUL_BOOT_SEQUENCE_READY_WAIT__"
-
+/**
+ * @brief Definition for AUL: The timeout.
+ * @since_tizen 7.0
+ */
#define AUL_K_TIMEOUT "__AUL_TIMEOUT__"
+
+/**
+ * @brief Definition for AUL: The begin timestamp of boot sequence app's start.
+ * @since_tizen 7.0
+ */
+#define AUL_K_BEGIN_TIMESTAMP "__AUL_BEGIN_TIMESTAMP__"
+
+/**
+ * @brief Definition for AUL: The end timestamp of boot sequence app's start.
+ * @since_tizen 7.0
+ */
+#define AUL_K_END_TIMESTAMP "__AUL_END_TIMESTAMP__"
return fd;
}
-int aul_sock_recv_pkt_with_cb(int fd,
+API int aul_sock_recv_pkt_with_cb(int fd,
void (*callback)(app_pkt_t *pkt, void *data),
void *user_data)
{
SET(TARGET_AULCTL "aulctl")
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} AULCTL_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/boot_sequence BS_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/operation OP_SRCS)
ADD_EXECUTABLE(${TARGET_AULCTL}
${AULCTL_SRCS}
+ ${BS_SRCS}
${OP_SRCS}
)
${TARGET_AUL_SERVER})
TARGET_INCLUDE_DIRECTORIES(${TARGET_AULCTL} PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../
${CMAKE_CURRENT_SOURCE_DIR}/../../src
${CMAKE_CURRENT_SOURCE_DIR}/../../include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../server
- ${CMAKE_CURRENT_SOURCE_DIR}/../../server/api)
+)
APPLY_PKG_CONFIG(${TARGET_AULCTL} PUBLIC
GLIB_DEPS
* limitations under the License.
*/
-#include "aul/boot_sequence/app_info.hh"
+#include "app_info.hh"
#include <bundle_internal.h>
return *this;
}
+AppInfo::Builder& AppInfo::Builder::SetBeginTimestamp(
+ const tizen_base::Bundle& args) {
+ begin_timestamp_ = args.GetString(AUL_K_BEGIN_TIMESTAMP);
+ return *this;
+}
+
+AppInfo::Builder& AppInfo::Builder::SetEndTimestamp(
+ const tizen_base::Bundle& args) {
+ end_timestamp_ = args.GetString(AUL_K_END_TIMESTAMP);
+ return *this;
+}
+
AppInfo* AppInfo::Builder::Build() const {
return new (std::nothrow) AppInfo(
std::move(appid_),
std::move(args_),
std::move(active_state_),
std::move(sub_state_),
+ std::move(begin_timestamp_),
+ std::move(end_timestamp_),
background_launch_,
wait_until_ready_,
timeout_);
std::set<std::string> requires, std::set<std::string> conflicts,
tizen_base::Bundle args,
std::string active_state, std::string sub_state,
+ std::string begin_timestamp, std::string end_timestamp,
bool background_launch, bool wait_until_ready, unsigned int timeout)
: appid_(std::move(appid)),
uid_(uid),
conflicts_(std::move(conflicts)),
args_(std::move(args)),
active_state_(std::move(active_state)),
+ sub_state_(std::move(sub_state)),
+ begin_timestamp_(std::move(begin_timestamp)),
+ end_timestamp_(std::move(end_timestamp)),
background_launch_(background_launch),
wait_until_ready_(wait_until_ready),
timeout_(timeout) {
return sub_state_;
}
+const std::string& AppInfo::GetBeginTimestamp() const {
+ return begin_timestamp_;
+}
+
+const std::string& AppInfo::GetEndTimestamp() const {
+ return end_timestamp_;
+}
+
const std::string& AppInfo::GetStatusMessage() const {
return status_msg_;
}
* limitations under the License.
*/
-/*
- * This header is only appfw internal api.
- * It is cpp header.
- */
-
-#ifndef AUL_INTERNAL_BOOT_SEQUENCE_APP_INFO_HH_
-#define AUL_INTERNAL_BOOT_SEQUENCE_APP_INFO_HH_
+#ifndef AULCTL_BOOT_SEQUENCE_APP_INFO_HH_
+#define AULCTL_BOOT_SEQUENCE_APP_INFO_HH_
#include <bundle_cpp.h>
Builder& SetTimeout(const tizen_base::Bundle& args);
Builder& SetActiveState(const tizen_base::Bundle& args);
Builder& SetSubState(const tizen_base::Bundle& args);
+ Builder& SetBeginTimestamp(const tizen_base::Bundle& args);
+ Builder& SetEndTimestamp(const tizen_base::Bundle& args);
+
AppInfo* Build() const;
private:
tizen_base::Bundle args_;
std::string active_state_;
std::string sub_state_;
+ std::string begin_timestamp_;
+ std::string end_timestamp_;
bool background_launch_;
bool wait_until_ready_;
unsigned int timeout_;
std::set<std::string> requires, std::set<std::string> conflicts,
tizen_base::Bundle args,
std::string active_state, std::string sub_state,
+ std::string begin_timestamp, std::string end_timestamp,
bool background_launch, bool wait_until_ready, unsigned int timeout);
const std::string& GetAppId() const;
unsigned int GetTimeout() const;
const std::string& GetActiveState() const;
const std::string& GetSubState() const;
+ const std::string& GetBeginTimestamp() const;
+ const std::string& GetEndTimestamp() const;
const std::string& GetStatusMessage() const;
private:
std::vector<std::string> required_by_;
tizen_base::Bundle args_;
std::string active_state_;
+ std::string sub_state_;
+ std::string begin_timestamp_;
+ std::string end_timestamp_;
bool background_launch_;
bool wait_until_ready_;
unsigned int timeout_;
- std::string sub_state_ = "dead";
std::string status_msg_;
};
} // namespace aul::internal
-#endif // AUL_INTERNAL_BOOT_SEQUENCE_APP_INFO_HH_
+#endif // AULCTL_BOOT_SEQUENCE_APP_INFO_HH_
* limitations under the License.
*/
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence_manager.hh"
#include <unistd.h>
.SetArgs(b)
.SetTimeout(b)
.SetActiveState(b)
- .SetSubState(b);
+ .SetSubState(b)
+ .SetBeginTimestamp(b)
+ .SetEndTimestamp(b);
return std::shared_ptr<AppInfo>(builder.Build());
}
* limitations under the License.
*/
-/*
- * This header is only appfw internal api.
- * It is cpp header.
- */
-
-#ifndef AUL_INTERNAL_BOOT_SEQUENCE_BOOT_SEQUENCE_MANAGER_HH_
-#define AUL_INTERNAL_BOOT_SEQUENCE_BOOT_SEQUENCE_MANAGER_HH_
+#ifndef AULCTL_BOOT_SEQUENCE_BOOT_SEQUENCE_MANAGER_HH_
+#define AULCTL_BOOT_SEQUENCE_BOOT_SEQUENCE_MANAGER_HH_
#include <bundle_cpp.h>
#include <vector>
#include "include/aul_sock.h"
-#include "aul/boot_sequence/app_info.hh"
+#include "app_info.hh"
namespace aul::internal {
namespace boot_sequence {
} // namespace boot_sequence
} // namespace aul::internal
-#endif // AUL_INTERNAL_BOOT_SEQUENCE_BOOT_SEQUENCE_MANAGER_HH_
+#endif // AULCTL_BOOT_SEQUENCE_BOOT_SEQUENCE_MANAGER_HH_
#include <string>
#include <utility>
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {
#include <iostream>
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {
#include <string>
#include <vector>
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {
return false;
}
- std::cout << uid_ << " user boot sequence app dependencies" << std::endl;
std::map<std::string, internal::boot_sequence::AppInfoPtr> infos;
std::map<std::string, int> req_cnt;
for (auto& app : app_list) {
if (req_cnt.find(app->GetAppId()) == req_cnt.end())
req_cnt[app->GetAppId()] = 0;
- for (auto &appid : app->AfterGet())
+ for (auto &appid : app->BeforeGet())
req_cnt[appid]++;
}
- /* depth, appinfo */
- std::stack<std::pair<int, internal::boot_sequence::AppInfoPtr>> stack;
+ std::stack<internal::boot_sequence::AppInfoPtr> stack;
for (auto& [appid, cnt] : req_cnt) {
if (cnt == 0 && infos.find(appid) != infos.end())
- stack.emplace(0, infos[appid]);
+ stack.push(infos[appid]);
}
while (!stack.empty()) {
- auto [cnt, app] = std::move(stack.top());
+ auto app = std::move(stack.top());
stack.pop();
- for (int i = 0; i < cnt; ++i)
- std::cout << "+";
-
std::cout << app->GetAppId() << std::endl;
- for (auto& appid : app->AfterGet()) {
- if (--req_cnt[appid] == 0 && infos.find(appid) != infos.end()) {
- stack.emplace(cnt + 1, infos[appid]);
- } else {
- for (int i = 0; i < cnt + 1; ++i)
- std::cout << "+";
-
- std::cout << appid << std::endl;
- }
+ std::cout << " After: ";
+ for (auto& appid : app->AfterGet())
+ std::cout << appid << ' ';
+
+ std::cout << std::endl << " Before: ";
+ for (auto& appid : app->BeforeGet())
+ std::cout << appid << ' ';
+
+ std::cout << std::endl << " Conflicts: ";
+ for (auto& appid : app->ConflictsGet())
+ std::cout << appid << ' ';
+
+ std::cout << std::endl;
+ std::cout << "============================================" << std::endl;
+ for (auto& appid : app->BeforeGet()) {
+ if (--req_cnt[appid] == 0 && infos.find(appid) != infos.end())
+ stack.push(infos[appid]);
}
}
#include <iostream>
#include "include/aul.h"
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {
#include <iostream>
#include "include/aul.h"
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {
#include <utility>
#include "aul/api/aul_app_context.h"
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {
std::cout << "appid: " << app->GetAppId() << std::endl;
std::cout << "status: " << app->GetActiveState() << std::endl;
+ std::cout << "sub status: " << app->GetSubState() << std::endl;
aul_app_context_h context;
int ret = aul_app_context_create(app->GetAppId().c_str(), &context);
aul_app_context_destroy(context);
}
+ std::cout << "begin: " << app->GetBeginTimestamp() << std::endl;
+ std::cout << "end: " << app->GetEndTimestamp() << std::endl;
std::cout << "requires: ";
for (auto& appid : app->RequiresGet())
std::cout << appid << " ";
#include <string>
#include <utility>
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
#include "aul_app_context.h"
#include "aul_boot_sequence.h"
std::cout << "appid: " << app->GetAppId() << std::endl;
std::cout << "status: " << app->GetActiveState() << std::endl;
+ std::cout << "sub status: " << app->GetSubState() << std::endl;
aul_app_context_h context;
int ret = aul_app_context_create(app->GetAppId().c_str(), &context);
aul_app_context_destroy(context);
}
+ std::cout << "begin: " << app->GetBeginTimestamp() << std::endl;
+ std::cout << "end: " << app->GetEndTimestamp() << std::endl;
std::cout << "requires: ";
for (auto& appid : app->RequiresGet())
std::cout << appid << " ";
#include "aul/api/aul_app_context.h"
#include "include/aul.h"
-#include "aul/boot_sequence/boot_sequence_manager.hh"
+#include "boot_sequence/boot_sequence_manager.hh"
namespace aul {