#include <iostream>
#include "lib/amd_launch.h"
+#include "lib/amd_login_monitor.h"
#include "lib/amd_noti.h"
#include "lib/amd_signal.h"
#include "lib/app_info/app_info_manager.hh"
_noti_listen(AMD_NOTI_MSG_APP_STATUS_SET_REAL_PID, OnAppStatusSetRealPid);
_noti_listen(AMD_NOTI_MSG_APP_STATUS_CLEANUP, OnAppStatusCleanup);
_noti_listen(AMD_NOTI_MSG_APP_STATUS_ADD, OnAppStatusAdd);
- _noti_listen(AMD_NOTI_MSG_APPINFO_LOAD, OnAppInfoLoad);
_noti_listen(AMD_NOTI_MSG_APPINFO_REMOVE, OnAppInfoRemove);
+ _noti_listen(AMD_NOTI_MSG_LOGIN_MONITOR_LOGIN, OnLoginMonitorLogin);
disposed_ = false;
}
return NOTI_CONTINUE;
}
-int BootSequencer::OnAppInfoLoad(const char* msg, int arg1, int arg2,
- void* arg3, bundle* arg4) {
- uid_t uid = static_cast<uid_t>(arg1);
- auto& inst = BootSequencer::GetInst();
- inst.Load(uid);
- inst.Start(uid);
- return NOTI_CONTINUE;
-}
-
int BootSequencer::OnAppInfoRemove(const char* msg, int arg1, int arg2,
void* arg3, bundle* arg4) {
uid_t uid = static_cast<uid_t>(arg1);
return NOTI_CONTINUE;
}
+int BootSequencer::OnLoginMonitorLogin(const char* msg, int arg1, int arg2,
+ void* arg3, bundle* arg4) {
+ uid_state state = static_cast<uid_state>(arg2);
+ if (state == UID_STATE_ONLINE || state == UID_STATE_ACTIVE) {
+ uid_t uid = static_cast<uid_t>(arg1);
+ auto& inst = BootSequencer::GetInst();
+ inst.Load(uid);
+ inst.Start(uid);
+ }
+
+ return NOTI_CONTINUE;
+}
+
void BootSequencer::PrintLog(const char* tag, const char* format, ...) {
if (logger_ == nullptr)
return;
bundle* arg4);
static int OnAppStatusAdd(const char* msg, int arg1, int arg2, void* arg3,
bundle* arg4);
- static int OnAppInfoLoad(const char* msg, int arg1, int arg2, void* arg3,
- bundle* arg4);
static int OnAppInfoRemove(const char* msg, int arg1, int arg2, void* arg3,
bundle* arg4);
static int OnLaunchAppStartEnd(const char* msg, int arg1, int arg2,
void* arg3, bundle* arg4);
+ static int OnLoginMonitorLogin(const char* msg, int arg1, int arg2,
+ void* arg3, bundle* arg4);
void PrintLog(const char* tag, const char* format, ...);
void PrintDependencies(const std::shared_ptr<AppInfo>& app_info);