Only use special Redex package name for external roots
Only use special Redex package name for external roots

Summary:
As a part of the full name of a shape class, we infer the package name based that of the root type. However, if the root type is an external type, it's not safe to do so. In that case, the shape class we generate will end up having an external package name, e.g., `Ljava/lang/`. This could cause confusion for custom class loaders, since they will delegate loading of external classes to system default class loader.

In case the root type is external, we would use `Lcom/facebook/redex/` package name instead as a fall back. However, the current logic checking if the root type is external is a bit too lenient. We might consider non-external types as external, e.g., `Landroidx`. This change tightens the check on the external-ness of the root type.

Reviewed By: wsanville

Differential Revision: D38372742

fbshipit-source-id: 4040ad2ca01ab29cb28024c457a175c4dcc40a8a

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex