Lines Matching refs:session

1188   auto session = ApexSession::GetSession(session_id);  in abortStagedSession()  local
1189 if (!session) { in abortStagedSession()
1192 switch (session->GetState()) { in abortStagedSession()
1196 return session->DeleteSession(); in abortStagedSession()
1198 return Error() << "Session " << *session << " can't be aborted"; in abortStagedSession()
1329 const ApexSession& session) { in snapshotOrRestoreDeIfNeeded() argument
1330 if (session.HasRollbackEnabled()) { in snapshotOrRestoreDeIfNeeded()
1331 for (const auto& apex_name : session.GetApexNames()) { in snapshotOrRestoreDeIfNeeded()
1333 snapshotDataDirectory(base_dir, session.GetRollbackId(), apex_name); in snapshotOrRestoreDeIfNeeded()
1339 } else if (session.IsRollback()) { in snapshotOrRestoreDeIfNeeded()
1340 for (const auto& apex_name : session.GetApexNames()) { in snapshotOrRestoreDeIfNeeded()
1343 snapshotDataDirectory(base_dir, session.GetRollbackId(), apex_name, in snapshotOrRestoreDeIfNeeded()
1347 restoreDataDirectory(base_dir, session.GetRollbackId(), apex_name); in snapshotOrRestoreDeIfNeeded()
1359 for (const ApexSession& session : sessions) { in snapshotOrRestoreDeSysData() local
1360 snapshotOrRestoreDeIfNeeded(kDeSysDataDir, session); in snapshotOrRestoreDeSysData()
1374 for (const ApexSession& session : sessions) { in snapshotOrRestoreDeUserData() local
1376 snapshotOrRestoreDeIfNeeded(user_dir, session); in snapshotOrRestoreDeUserData()
1454 const ApexSession& session) { in restorePreRestoreSnapshotsIfPresent() argument
1457 session.GetRollbackId(), kPreRestoreSuffix); in restorePreRestoreSnapshotsIfPresent()
1459 for (const auto& apex_name : session.GetApexNames()) { in restorePreRestoreSnapshotsIfPresent()
1461 base_dir, session.GetRollbackId(), apex_name, true /* pre_restore */); in restorePreRestoreSnapshotsIfPresent()
1476 void restoreDePreRestoreSnapshotsIfPresent(const ApexSession& session) { in restoreDePreRestoreSnapshotsIfPresent() argument
1477 restorePreRestoreSnapshotsIfPresent(kDeSysDataDir, session); in restoreDePreRestoreSnapshotsIfPresent()
1486 restorePreRestoreSnapshotsIfPresent(user_dir, session); in restoreDePreRestoreSnapshotsIfPresent()
1491 const ApexSession& session) { in deleteDePreRestoreSnapshots() argument
1494 session.GetRollbackId(), kPreRestoreSuffix); in deleteDePreRestoreSnapshots()
1501 void deleteDePreRestoreSnapshots(const ApexSession& session) { in deleteDePreRestoreSnapshots() argument
1502 deleteDePreRestoreSnapshots(kDeSysDataDir, session); in deleteDePreRestoreSnapshots()
1511 deleteDePreRestoreSnapshots(user_dir, session); in deleteDePreRestoreSnapshots()
1563 for (auto& session : sessionsToActivate) { in scanStagedSessionsDirAndStage() local
1564 auto sessionId = session.GetId(); in scanStagedSessionsDirAndStage()
1568 auto st = session.UpdateStateAndCommit(SessionState::ACTIVATION_FAILED); in scanStagedSessionsDirAndStage()
1577 if (session.GetBuildFingerprint().compare(build_fingerprint) != 0) { in scanStagedSessionsDirAndStage()
1583 if (session.GetChildSessionIds().empty()) { in scanStagedSessionsDirAndStage()
1587 for (auto childSessionId : session.GetChildSessionIds()) { in scanStagedSessionsDirAndStage()
1639 session.AddApexName(apex_file->GetManifest().name()); in scanStagedSessionsDirAndStage()
1652 auto st = session.UpdateStateAndCommit(SessionState::ACTIVATED); in scanStagedSessionsDirAndStage()
1654 LOG(ERROR) << "Failed to mark " << session in scanStagedSessionsDirAndStage()
1815 for (auto& session : activeSessions) { in revertActiveSessions() local
1817 session.SetCrashingNativeProcess(crashing_native_process); in revertActiveSessions()
1820 session.UpdateStateAndCommit(SessionState::REVERT_IN_PROGRESS); in revertActiveSessions()
1822 return Error() << "Revert of session " << session in revertActiveSessions()
1830 for (auto& session : activeSessions) { in revertActiveSessions() local
1831 auto st = session.UpdateStateAndCommit(SessionState::REVERT_FAILED); in revertActiveSessions()
1832 LOG(DEBUG) << "Marking " << session << " as failed to revert"; in revertActiveSessions()
1834 LOG(WARNING) << "Failed to mark session " << session in revertActiveSessions()
1844 for (auto& session : activeSessions) { in revertActiveSessions() local
1845 if (!gInFsCheckpointMode && session.IsRollback()) { in revertActiveSessions()
1848 restoreDePreRestoreSnapshotsIfPresent(session); in revertActiveSessions()
1851 auto status = session.UpdateStateAndCommit(SessionState::REVERTED); in revertActiveSessions()
1853 LOG(WARNING) << "Failed to mark session " << session in revertActiveSessions()
2115 auto session = ApexSession::CreateSession(session_id); in submitStagedSession() local
2116 if (!session.ok()) { in submitStagedSession()
2117 return session.error(); in submitStagedSession()
2119 (*session).SetChildSessionIds(child_session_ids); in submitStagedSession()
2121 (*session).SetBuildFingerprint(build_fingerprint); in submitStagedSession()
2122 session->SetHasRollbackEnabled(has_rollback_enabled); in submitStagedSession()
2123 session->SetIsRollback(is_rollback); in submitStagedSession()
2124 session->SetRollbackId(rollback_id); in submitStagedSession()
2126 (*session).UpdateStateAndCommit(SessionState::VERIFIED); in submitStagedSession()
2135 auto session = ApexSession::GetSession(session_id); in markStagedSessionReady() local
2136 if (!session.ok()) { in markStagedSessionReady()
2137 return session.error(); in markStagedSessionReady()
2142 auto session_state = (*session).GetState(); in markStagedSessionReady()
2147 return (*session).UpdateStateAndCommit(SessionState::STAGED); in markStagedSessionReady()
2154 auto session = ApexSession::GetSession(session_id); in markStagedSessionSuccessful() local
2155 if (!session.ok()) { in markStagedSessionSuccessful()
2156 return session.error(); in markStagedSessionSuccessful()
2160 if (session->GetState() == SessionState::SUCCESS) { in markStagedSessionSuccessful()
2162 } else if (session->GetState() == SessionState::ACTIVATED) { in markStagedSessionSuccessful()
2165 return Error() << "Failed to mark session " << *session in markStagedSessionSuccessful()
2168 if (session->IsRollback() && !gInFsCheckpointMode) { in markStagedSessionSuccessful()
2169 deleteDePreRestoreSnapshots(*session); in markStagedSessionSuccessful()
2171 return session->UpdateStateAndCommit(SessionState::SUCCESS); in markStagedSessionSuccessful()
2173 return Error() << "Session " << *session << " can not be marked successful"; in markStagedSessionSuccessful()