diff options
author | Johan Redestig <johan.redestig@sonymobile.com> | 2012-10-05 10:33:16 +0200 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonymobile.com> | 2013-03-26 07:59:14 +0100 |
commit | 910b2116b0f1d3efdb95d663003a2181bf9faf33 (patch) | |
tree | 5dc3cf318dd323a88e878b5bcafdfe3b98a62ad1 /src/com/android/settings/applications | |
parent | ae9ebfd153d63beb03c018786cb3a7ca7610ce64 (diff) | |
download | packages_apps_Settings-910b2116b0f1d3efdb95d663003a2181bf9faf33.zip packages_apps_Settings-910b2116b0f1d3efdb95d663003a2181bf9faf33.tar.gz packages_apps_Settings-910b2116b0f1d3efdb95d663003a2181bf9faf33.tar.bz2 |
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
Diffstat (limited to 'src/com/android/settings/applications')
-rw-r--r-- | src/com/android/settings/applications/RunningState.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/settings/applications/RunningState.java b/src/com/android/settings/applications/RunningState.java index 5797dfa..d373fdd 100644 --- a/src/com/android/settings/applications/RunningState.java +++ b/src/com/android/settings/applications/RunningState.java @@ -462,6 +462,12 @@ public class RunningState { 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, |