release-request-767e2998-9243-43e0-b656-1acb30ac5115-for-git_oc-release-4124637 snap-temp-L74200000076595014

Change-Id: Ic8125b71bd49a66e2b7278d66077df54172e260b
diff --git a/src/com/android/tradefed/invoker/ITestInvocation.java b/src/com/android/tradefed/invoker/ITestInvocation.java
index d2d29c1..0214071 100644
--- a/src/com/android/tradefed/invoker/ITestInvocation.java
+++ b/src/com/android/tradefed/invoker/ITestInvocation.java
@@ -18,7 +18,6 @@
 
 import com.android.tradefed.config.IConfiguration;
 import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.result.ITestInvocationListener;
 
 /**
@@ -28,26 +27,6 @@
 
     /**
      * Perform the test invocation.
-     * FIXME: Remove when fully moved to new interface.
-     *
-     * @param device the {@link ITestDevice} to perform tests.
-     * @param config the {@link IConfiguration} of this test run.
-     * @param rescheduler the {@link IRescheduler}, for rescheduling portions of the invocation for
-     *        execution on another resource(s)
-     * @param extraListeners {@link ITestInvocationListener}s to notify, in addition to those in
-     *        <var>config</var>
-     * @throws DeviceNotAvailableException if communication with device was lost
-     * @throws Throwable
-     * @deprecated Use {@link #invoke(IInvocationContext, IConfiguration, IRescheduler,
-     *        ITestInvocationListener...)} instead.
-     */
-    @Deprecated
-    public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler,
-            ITestInvocationListener... extraListeners) throws DeviceNotAvailableException,
-            Throwable;
-
-    /**
-     * Perform the test invocation.
      *
      * @param metadata the {@link IInvocationContext} to perform tests.
      * @param config the {@link IConfiguration} of this test run.
diff --git a/src/com/android/tradefed/invoker/TestInvocation.java b/src/com/android/tradefed/invoker/TestInvocation.java
index f08cbbb..2d42caa 100644
--- a/src/com/android/tradefed/invoker/TestInvocation.java
+++ b/src/com/android/tradefed/invoker/TestInvocation.java
@@ -22,7 +22,6 @@
 import com.android.tradefed.build.IBuildProvider;
 import com.android.tradefed.build.IDeviceBuildProvider;
 import com.android.tradefed.command.CommandRunner.ExitCode;
-import com.android.tradefed.config.ConfigurationDef;
 import com.android.tradefed.config.GlobalConfiguration;
 import com.android.tradefed.config.IConfiguration;
 import com.android.tradefed.config.IDeviceConfiguration;
@@ -153,22 +152,6 @@
     }
 
     /**
-     * {@inheritDoc}
-     * @deprecated use {@link #invoke(IInvocationContext, IConfiguration, IRescheduler,
-            ITestInvocationListener[])} instead.
-     */
-    @Override
-    @Deprecated
-    public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler,
-            ITestInvocationListener... extraListeners)
-            throws DeviceNotAvailableException, Throwable {
-        IInvocationContext context = new InvocationContext();
-        context.setConfigurationDescriptor(config.getConfigurationDescription());
-        context.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, device);
-        invoke(context, config, rescheduler, extraListeners);
-    }
-
-    /**
      * Attempt to shard the configuration into sub-configurations, to be re-scheduled to run on
      * multiple resources in parallel.
      *
diff --git a/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java b/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java
index f05f2ab..0ad2d99 100644
--- a/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java
+++ b/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java
@@ -199,9 +199,11 @@
         public boolean runInterrupted = false;
         public boolean printedStop = false;
 
-        @Deprecated
         @Override
-        public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler,
+        public void invoke(
+                IInvocationContext metadata,
+                IConfiguration config,
+                IRescheduler rescheduler,
                 ITestInvocationListener... listeners)
                 throws DeviceNotAvailableException {
             try {
@@ -239,14 +241,6 @@
         }
 
         @Override
-        public void invoke(
-                IInvocationContext metadata, IConfiguration config, IRescheduler rescheduler,
-                ITestInvocationListener... extraListeners)
-                        throws DeviceNotAvailableException, Throwable {
-            invoke(metadata.getDevices().get(0), config, rescheduler, extraListeners);
-        }
-
-        @Override
         public void notifyInvocationStopped() {
             printedStop = true;
         }
@@ -467,9 +461,11 @@
             mIteration = iteration;
         }
 
-        @Deprecated
         @Override
-        public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler,
+        public void invoke(
+                IInvocationContext metadata,
+                IConfiguration config,
+                IRescheduler rescheduler,
                 ITestInvocationListener... listeners)
                 throws DeviceNotAvailableException {
             try {
@@ -492,14 +488,6 @@
                 }
             }
         }
-
-        @Override
-        public void invoke(
-                IInvocationContext metadata, IConfiguration config, IRescheduler rescheduler,
-                ITestInvocationListener... extraListeners)
-                        throws DeviceNotAvailableException, Throwable {
-            invoke(metadata.getDevices().get(0), config, rescheduler, extraListeners);
-        }
     }
 
     /**