[core] Get rid of NPE
This commit is contained in:
parent
6e115426e4
commit
db18cfcb60
|
|
@ -70,10 +70,12 @@ public class PackageService {
|
||||||
public static Set<String> fetchProcesses(PackageInfo pkgInfo) {
|
public static Set<String> fetchProcesses(PackageInfo pkgInfo) {
|
||||||
HashSet<String> processNames = new HashSet<>();
|
HashSet<String> processNames = new HashSet<>();
|
||||||
for (ComponentInfo[] componentInfos : new ComponentInfo[][]{pkgInfo.activities, pkgInfo.receivers, pkgInfo.providers}) {
|
for (ComponentInfo[] componentInfos : new ComponentInfo[][]{pkgInfo.activities, pkgInfo.receivers, pkgInfo.providers}) {
|
||||||
|
if (componentInfos == null) continue;
|
||||||
for (ComponentInfo componentInfo : componentInfos) {
|
for (ComponentInfo componentInfo : componentInfos) {
|
||||||
processNames.add(componentInfo.processName);
|
processNames.add(componentInfo.processName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (pkgInfo.services == null) return processNames;
|
||||||
for (ServiceInfo service : pkgInfo.services) {
|
for (ServiceInfo service : pkgInfo.services) {
|
||||||
if ((service.flags & FLAG_ISOLATED_PROCESS) == 0) {
|
if ((service.flags & FLAG_ISOLATED_PROCESS) == 0) {
|
||||||
processNames.add(service.processName);
|
processNames.add(service.processName);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue