Apple and Samsung settle lengthy iPhone patent battle