Fix NullPointerException at RunningState
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
This commit is contained in:
committed by
The Android Automerger
parent
af442496a9
commit
9b70a21960
@@ -462,6 +462,12 @@ public class RunningState {
|
|||||||
si.mServiceInfo = ActivityThread.getPackageManager().getServiceInfo(
|
si.mServiceInfo = ActivityThread.getPackageManager().getServiceInfo(
|
||||||
service.service, PackageManager.GET_UNINSTALLED_PACKAGES,
|
service.service, PackageManager.GET_UNINSTALLED_PACKAGES,
|
||||||
UserHandle.getUserId(service.uid));
|
UserHandle.getUserId(service.uid));
|
||||||
|
|
||||||
|
if (si.mServiceInfo == null) {
|
||||||
|
Log.d("RunningService", "getServiceInfo returned null for: "
|
||||||
|
+ service.service);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
si.mDisplayLabel = makeLabel(pm,
|
si.mDisplayLabel = makeLabel(pm,
|
||||||
|
Reference in New Issue
Block a user