Huawei had planned for the possibility of a US ban: the company has been developing its own operating system, it has said.