The phone maker has able to close the gap through strong growth in China