PackageManageris abstract, and a concrete implementation must be provided to invoke instance methods. An implementation of this class can be found as a private private package class ApplicationContext, which itself is available in ContextImpl. (For source code see here ). Please note that this PackageManager implementation is final and therefore cannot be overridden.
MockPackageManager, .