Apple and HTC end patent disputes