diff options
author | Matthew Williams <mjwilliams@google.com> | 2014-05-16 21:50:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-16 21:50:38 +0000 |
commit | b8b99c0fc0c22d509c500af5eadec8f7edd75c8f (patch) | |
tree | 7b7f7a20f3a11a19b450c2b020be81a79e179187 /services | |
parent | 4b300d7dcbe47035ce6cea3fab6eff76bdc4d803 (diff) | |
parent | fdd920319201d241f053a287e342a900934f8e73 (diff) | |
download | frameworks_base-b8b99c0fc0c22d509c500af5eadec8f7edd75c8f.zip frameworks_base-b8b99c0fc0c22d509c500af5eadec8f7edd75c8f.tar.gz frameworks_base-b8b99c0fc0c22d509c500af5eadec8f7edd75c8f.tar.bz2 |
Merge "Refactored code didn't make it into previous CL"
Diffstat (limited to 'services')
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); |