summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMatthew Williams <mjwilliams@google.com>2014-05-16 14:18:05 -0700
committerMatthew Williams <mjwilliams@google.com>2014-05-16 14:48:39 -0700
commitfdd920319201d241f053a287e342a900934f8e73 (patch)
tree17e49adcd25c25557eec3bfacb350b96655267e9 /services
parent4b291fbffc22c47f55355d79c8d1cbe8ac6742dc (diff)
downloadframeworks_base-fdd920319201d241f053a287e342a900934f8e73.zip
frameworks_base-fdd920319201d241f053a287e342a900934f8e73.tar.gz
frameworks_base-fdd920319201d241f053a287e342a900934f8e73.tar.bz2
Refactored code didn't make it into previous CL
Change-Id: I7ec93e783267d0c0fb39fbc8d0abe7270bdaea68
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/task/StateChangedListener.java6
-rw-r--r--services/core/java/com/android/server/task/TaskManagerService.java3
-rw-r--r--services/core/java/com/android/server/task/TaskServiceContext.java4
-rw-r--r--services/core/java/com/android/server/task/controllers/ConnectivityController.java6
4 files changed, 9 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/task/StateChangedListener.java b/services/core/java/com/android/server/task/StateChangedListener.java
index a87bf95..db2d4ee 100644
--- a/services/core/java/com/android/server/task/StateChangedListener.java
+++ b/services/core/java/com/android/server/task/StateChangedListener.java
@@ -19,9 +19,9 @@ package com.android.server.task;
import com.android.server.task.controllers.TaskStatus;
/**
- * Interface through which a {@link StateController} informs the
- * {@link com.android.server.task.TaskManagerService} that there are some tasks potentially ready
- * to be run.
+ * Interface through which a {@link com.android.server.task.controllers.StateController} informs
+ * the {@link com.android.server.task.TaskManagerService} that there are some tasks potentially
+ * ready to be run.
*/
public interface StateChangedListener {
/**
diff --git a/services/core/java/com/android/server/task/TaskManagerService.java b/services/core/java/com/android/server/task/TaskManagerService.java
index 1b3a927..6d208ff 100644
--- a/services/core/java/com/android/server/task/TaskManagerService.java
+++ b/services/core/java/com/android/server/task/TaskManagerService.java
@@ -136,7 +136,6 @@ public class TaskManagerService extends com.android.server.SystemService
* For now this takes the task and if it's ready to run it will run it. In future we might not
* provide the task, so that the StateChangedListener has to run through its list of tasks to
* see which are ready. This will further decouple the controllers from the execution logic.
- * @param taskStatus The state of the task which has changed.
*/
@Override
public void onTaskStateChanged(TaskStatus taskStatus) {
@@ -170,7 +169,7 @@ public class TaskManagerService extends com.android.server.SystemService
}
@Override
- public void onClientExecutionCompleted(int serviceToken) {
+ public void onAllTasksCompleted(int serviceToken) {
}
diff --git a/services/core/java/com/android/server/task/TaskServiceContext.java b/services/core/java/com/android/server/task/TaskServiceContext.java
index 2d148d5..b51cbb3 100644
--- a/services/core/java/com/android/server/task/TaskServiceContext.java
+++ b/services/core/java/com/android/server/task/TaskServiceContext.java
@@ -230,7 +230,7 @@ public class TaskServiceContext extends ITaskCallback.Stub implements ServiceCon
* tasks, then we do the shutdown.
*/
private void startShutdown() {
- mCompletedListener.onClientExecutionCompleted(token);
+ mCompletedListener.onAllTasksCompleted(token);
mCallbackHandler.obtainMessage(MSG_SHUTDOWN).sendToTarget();
}
@@ -389,7 +389,7 @@ public class TaskServiceContext extends ITaskCallback.Stub implements ServiceCon
* This TaskServiceContext is shutting down. Remove all the tasks from the pending queue
* and reschedule them as if they had failed.
* Before posting this message, caller must invoke
- * {@link com.android.server.task.TaskCompletedListener#onClientExecutionCompleted(int)}
+ * {@link com.android.server.task.TaskCompletedListener#onAllTasksCompleted(int)}.
*/
private void handleShutdownH() {
for (int i = 0; i < mPending.size(); i++) {
diff --git a/services/core/java/com/android/server/task/controllers/ConnectivityController.java b/services/core/java/com/android/server/task/controllers/ConnectivityController.java
index fad41d9..6a4e1f3 100644
--- a/services/core/java/com/android/server/task/controllers/ConnectivityController.java
+++ b/services/core/java/com/android/server/task/controllers/ConnectivityController.java
@@ -56,7 +56,7 @@ public class ConnectivityController extends StateController {
}
@Override
- public void maybeStartTrackingTask(TaskStatus taskStatus) {
+ public void maybeTrackTaskState(TaskStatus taskStatus) {
if (taskStatus.hasConnectivityConstraint() || taskStatus.hasMeteredConstraint()) {
taskStatus.connectivityConstraintSatisfied.set(mConnectivity);
taskStatus.meteredConstraintSatisfied.set(mMetered);
@@ -65,7 +65,7 @@ public class ConnectivityController extends StateController {
}
@Override
- public void maybeStopTrackingTask(TaskStatus taskStatus) {
+ public void removeTaskStateIfTracked(TaskStatus taskStatus) {
mTrackedTasks.remove(taskStatus);
}
@@ -111,7 +111,7 @@ public class ConnectivityController extends StateController {
mMetered = false;
mConnectivity =
!intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
- if (isConnected) { // No point making the call if we know there's no conn.
+ if (mConnectivity) { // No point making the call if we know there's no conn.
mMetered = connManager.isActiveNetworkMetered();
}
updateTrackedTasks(userid);