Who provides implementation(s) of the PackageManag

2019-06-21 03:52发布

I am looking at source code for the PackageManager class and it is abstract as well as all the methods. Are manufacturers supposed to write a real implementation for it, or I am missing something?

标签: android class
4条回答
Melony?
2楼-- · 2019-06-21 04:08

For anyone stumbling upon this old question, go to the source (android.googlesource.com) https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/pm/PackageManagerService.java, grepcode is long gone.

查看更多
不美不萌又怎样
3楼-- · 2019-06-21 04:10

The real implementation for the PackageManager is PackageManagerService located at frameworks/base/services/java/com/android/server/

You can find the source code here in the GrepCode.

查看更多
beautiful°
4楼-- · 2019-06-21 04:15
Luminary・发光体
5楼-- · 2019-06-21 04:20

PackageManager is abstract and a concrete implementation needs to be provided in order to invoke instance methods. An implementation of this class can be found as a package private static class of ApplicationContext which itself is available in ContextImpl. (For source code see here). Note that this implementation of PackageManager is final and so cannot be overriden.

There is also a MockPackageManager implementation that might interest you.

查看更多
登录 后发表回答