Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fd58003 authored by Johan Redestig's avatar Johan Redestig Committed by Amith Yamasani
Browse files

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
parent 6fa5e627
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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,