Samsung agrees to pay Apple $548 million in damages—with conditions