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

Commit 970e3f41 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #29069028 NYC: device boot failure: NPE in AppIdleController

Make sure the core parts of JobSchedulerService are initialized
before we start creating the controllers.

Change-Id: I497df12f7e6fbd93581291ec691c4b45104d67d0
parent 438693dd
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -717,6 +717,11 @@ public final class JobSchedulerService extends com.android.server.SystemService
     */
     */
    public JobSchedulerService(Context context) {
    public JobSchedulerService(Context context) {
        super(context);
        super(context);
        mHandler = new JobHandler(context.getMainLooper());
        mConstants = new Constants(mHandler);
        mJobSchedulerStub = new JobSchedulerStub();
        mJobs = JobStore.initAndGet(this);

        // Create the controllers.
        // Create the controllers.
        mControllers = new ArrayList<StateController>();
        mControllers = new ArrayList<StateController>();
        mControllers.add(ConnectivityController.get(this));
        mControllers.add(ConnectivityController.get(this));
@@ -726,11 +731,6 @@ public final class JobSchedulerService extends com.android.server.SystemService
        mControllers.add(AppIdleController.get(this));
        mControllers.add(AppIdleController.get(this));
        mControllers.add(ContentObserverController.get(this));
        mControllers.add(ContentObserverController.get(this));
        mControllers.add(DeviceIdleJobsController.get(this));
        mControllers.add(DeviceIdleJobsController.get(this));

        mHandler = new JobHandler(context.getMainLooper());
        mConstants = new Constants(mHandler);
        mJobSchedulerStub = new JobSchedulerStub();
        mJobs = JobStore.initAndGet(this);
    }
    }


    @Override
    @Override