Samsung wins patent battle with Apple