Google two years ago agreed to cover some of Samsung’s potential legal costs as protection against Apple’s latest multibillion-dollar patent lawsuit, a rare glimpse into how closely the two companies aligned themselves in the smartphone wars, a federal court jury learned Tuesday. Apple disclosed emails and letters showing that Google executives agreed to pay some of Samsung’s legal costs if it loses its patent fight against Apple.