A man jailed for causing the death of a newborn boy will plead guilty to injuring another person just days before he fatally assaulted the baby, a court has been told.