getServiceInfo returns null if you have a service defined in the
manifest as: <service android:name=".Xxx" android:exported="false" />
or and in an <application> with no label or icon.
Dont crash the Settings application because of that.
Change-Id: I6f9f69c130e610b7e4ab66426177b7bade1e1515
si.mServiceInfo = ActivityThread.getPackageManager().getServiceInfo(
service.service, PackageManager.GET_UNINSTALLED_PACKAGES,
UserHandle.getUserId(service.uid));
+
+ if (si.mServiceInfo == null) {
+ Log.d("RunningService", "getServiceInfo returned null for: "
+ + service.service);
+ return false;
+ }
} catch (RemoteException e) {
}
si.mDisplayLabel = makeLabel(pm,