You can get ProvisioningJobfrom yours UpdateOperationthat it belongs to the family of running profile change tasks. See org.eclipse.core.runtime.jobs.Job.belongsTo(Object).
In addition, I have two ideas to do this using the internal API,
- try checking the profile lock to see if it will be changed.
org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.lockProfile(Profile) - run yours as before, but catch an IlegalStateException, then log
ProvisioningListenerin IProvisioningEventBusto receive notification of the completion of the current changechange.