BS. Warships do not arrive "unexpectedly". They require diplomatic clearance, port clearance, port services and more. People that needed to know, knew, period. Also, "dozens of boxes" of formula isn't exactly "embarrassing for China". It's just two or three sailors buying a small supply of better quality formula for their babies. If you want to be a blog pimp, at least steal some legit content.
Particularly so, but not only for warships. Many countries require advance notice of arrival for merchant ships as well.
I am not a blog pimp.