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

Commit b9583c9d authored by Christopher Tate's avatar Christopher Tate Committed by Christopher Tate
Browse files

Turn on debugging override of idle time

'adb shell am idle-maintenance' has traditionally been used to force
the system to consider itself to be in an "idle" state.  Unfortunately
the new Job Manager hadn't yet been aware of this.  Rectify the situation.

Also fixes a bug in debug logging that would cause a system server
crash under certain race circumstances.

Change-Id: I8a29bd7757924f8e464865235c344233fc03d8c3
parent ccf9fca4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1465,7 +1465,7 @@ public class Am extends BaseCommand {

        System.out.println("Performing idle maintenance...");
        Intent intent = new Intent(
                "com.android.server.IdleMaintenanceService.action.FORCE_IDLE_MAINTENANCE");
                "com.android.server.task.controllers.IdleController.ACTION_TRIGGER_IDLE");
        mAm.broadcastIntent(null, intent, null, null, 0, null, null, null,
                android.app.AppOpsManager.OP_NONE, true, false, UserHandle.USER_ALL);
    }
+2 −2
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
                case MSG_CALLBACK:
                    if (DEBUG) {
                        Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob + " v:" +
                                VERB_STRINGS[mVerb]);
                                (mVerb >= 0 ? VERB_STRINGS[mVerb] : "[invalid]"));
                    }
                    removeMessages(MSG_TIMEOUT);

@@ -518,7 +518,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
                    EXECUTING_TIMESLICE_MILLIS : OP_TIMEOUT_MILLIS;
            if (DEBUG) {
                Slog.d(TAG, "Scheduling time out for '" +
                        mRunningJob.getServiceComponent().getShortClassName() + "' tId: " +
                        mRunningJob.getServiceComponent().getShortClassName() + "' jId: " +
                        mParams.getJobId() + ", in " + (timeoutMillis / 1000) + " s");
            }
            Message m = mCallbackHandler.obtainMessage(MSG_TIMEOUT);
+3 −0
Original line number Diff line number Diff line
@@ -137,6 +137,9 @@ public class IdleController extends StateController {
            filter.addAction(Intent.ACTION_DREAMING_STARTED);
            filter.addAction(Intent.ACTION_DREAMING_STOPPED);

            // Debugging/instrumentation
            filter.addAction(ACTION_TRIGGER_IDLE);

            mContext.registerReceiver(this, filter);
        }