Adding idle maintenance service.

It is beneficial that there is a mechanism on the platform
to notify applications whether it is safe to perform somehow
expensive operations while the user is not using the device.
Thus, user experience will not be degraded. An example is
discarding of unused blocks on a mounted file system instead
of doing this on every write operation.

bug:8056794

Change-Id: I708bad9d3ce6c8f1d5a1c05c0abf46f81a3d464b
This commit is contained in:
Svetoslav
2013-02-13 14:39:30 -08:00
parent 7379a95a0b
commit b3038ec7cf
5 changed files with 270 additions and 1 deletions

View File

@@ -255,7 +255,7 @@ class ServerThread extends Thread {
}
ActivityManagerService.setSystemProcess();
Slog.i(TAG, "User Service");
ServiceManager.addService(Context.USER_SERVICE,
UserManagerService.getInstance());
@@ -736,6 +736,13 @@ class ServerThread extends Thread {
reportWtf("starting DreamManagerService", e);
}
}
try {
Slog.i(TAG, "IdleMaintenanceService");
new IdleMaintenanceService(context);
} catch (Throwable e) {
reportWtf("starting IdleMaintenanceService", e);
}
}
// Before things start rolling, be sure we have decided whether