Use inNamespaces instead of comparing getNamespaces.

This is the preferred way, according to the docs.

Change-Id: I1192f8ff92d017975e6b0f5f7828d9c6db859e66