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

Commit 9900add6 authored by Kweku Adams's avatar Kweku Adams Committed by Automerger Merge Worker
Browse files

Merge "Move JobScheduler off the main thread." into udc-dev am: feee7e8a

parents 7f552a65 feee7e8a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -533,7 +533,8 @@ class JobConcurrencyManager {
            mIdleContexts.add(
                    mInjector.createJobServiceContext(mService, this,
                            mNotificationCoordinator, batteryStats,
                            mService.mJobPackageTracker, mContext.getMainLooper()));
                            mService.mJobPackageTracker,
                            AppSchedulingModuleThread.get().getLooper()));
        }
    }

@@ -1925,7 +1926,7 @@ class JobConcurrencyManager {
        return mInjector.createJobServiceContext(mService, this, mNotificationCoordinator,
                IBatteryStats.Stub.asInterface(
                        ServiceManager.getService(BatteryStats.SERVICE_NAME)),
                mService.mJobPackageTracker, mContext.getMainLooper());
                mService.mJobPackageTracker, AppSchedulingModuleThread.get().getLooper());
    }

    @GuardedBy("mLock")
+1 −1
Original line number Diff line number Diff line
@@ -2009,7 +2009,7 @@ public class JobSchedulerService extends com.android.server.SystemService
        mActivityManagerInternal = Objects.requireNonNull(
                LocalServices.getService(ActivityManagerInternal.class));

        mHandler = new JobHandler(context.getMainLooper());
        mHandler = new JobHandler(AppSchedulingModuleThread.get().getLooper());
        mConstants = new Constants();
        mConstantsObserver = new ConstantsObserver();
        mJobSchedulerStub = new JobSchedulerStub();
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ public final class ConnectivityController extends RestrictingController implemen
    public ConnectivityController(JobSchedulerService service,
            @NonNull FlexibilityController flexibilityController) {
        super(service);
        mHandler = new CcHandler(mContext.getMainLooper());
        mHandler = new CcHandler(AppSchedulingModuleThread.get().getLooper());

        mConnManager = mContext.getSystemService(ConnectivityManager.class);
        mNetPolicyManagerInternal = LocalServices.getService(NetworkPolicyManagerInternal.class);
+2 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.util.SparseArray;
import android.util.TimeUtils;
import android.util.proto.ProtoOutputStream;

import com.android.server.AppSchedulingModuleThread;
import com.android.server.job.JobSchedulerService;
import com.android.server.job.StateControllerProto;
import com.android.server.job.StateControllerProto.ContentObserverController.Observer.TriggerContentData;
@@ -70,7 +71,7 @@ public final class ContentObserverController extends StateController {

    public ContentObserverController(JobSchedulerService service) {
        super(service);
        mHandler = new Handler(mContext.getMainLooper());
        mHandler = new Handler(AppSchedulingModuleThread.get().getLooper());
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.util.SparseBooleanArray;
import android.util.proto.ProtoOutputStream;

import com.android.internal.util.ArrayUtils;
import com.android.server.AppSchedulingModuleThread;
import com.android.server.DeviceIdleInternal;
import com.android.server.LocalServices;
import com.android.server.job.JobSchedulerService;
@@ -127,7 +128,7 @@ public final class DeviceIdleJobsController extends StateController {
    public DeviceIdleJobsController(JobSchedulerService service) {
        super(service);

        mHandler = new DeviceIdleJobsDelayHandler(mContext.getMainLooper());
        mHandler = new DeviceIdleJobsDelayHandler(AppSchedulingModuleThread.get().getLooper());
        // Register for device idle mode changes
        mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
        mLocalDeviceIdleController =
Loading