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
This commit is contained in:
Christopher Tate
2014-07-24 17:03:22 -07:00
committed by Christopher Tate
parent ccf9fca471
commit b9583c9d93
3 changed files with 6 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);
}