Package.getProfileApplication(
Profile profile)
Retrieves the application of the specified profile to this package, or null if no such profile is applied.
Package.getProfileApplication(
Profile profile,
boolean recurse)
Retrieves the application of the specified profile to this package or any of its nesting packages (if indicated), or null if no such profile is applied.