Fixing latency/apptransition test in legacy.

Running test: https://critique-ng.corp.google.com/cl/346171947
Test result: https://g3c.corp.google.com/results/invocations/1f779e9e-2ac1-4a6c-9d1c-d7bc2fe334aa/details

Bug: 171092238
Test: latency-fix-december

Change-Id: I4fc2e83fd9d9eeced2365d97d5421e1489420731
Merged-In: I4fc2e83fd9d9eeced2365d97d5421e1489420731
(cherry picked from commit 74cd19393a20dec944ab54123d86e4412f8d3eec)
diff --git a/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/AppTransitionTests.java b/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/AppTransitionTests.java
index 6d5136f..fcba902 100644
--- a/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/AppTransitionTests.java
+++ b/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/AppTransitionTests.java
@@ -106,9 +106,8 @@
 
     @Before
     public void setUp() throws Exception {
-        androidx.test.InstrumentationRegistry.registerInstance(this, new Bundle());
         mArgs = InstrumentationRegistry.getArguments();
-        mDevice = UiDevice.getInstance(getInstrumentation());
+        mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
         LauncherStrategyFactory factory = LauncherStrategyFactory.getInstance(mDevice);
         mLauncherStrategy = factory.getLauncherStrategy();
         mLauncher = new LauncherInstrumentation(getInstrumentation());
diff --git a/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/LatencyTests.java b/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/LatencyTests.java
index 39c4faf..e482da7 100644
--- a/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/LatencyTests.java
+++ b/tests/perf/PerfTransitionTest/src/com/android/apptransition/tests/LatencyTests.java
@@ -85,8 +85,7 @@
 
     @Before
     public void setUp() throws Exception {
-        androidx.test.InstrumentationRegistry.registerInstance(this, new Bundle());
-        mDevice = UiDevice.getInstance(getInstrumentation());
+        mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
         Bundle mArgs = InstrumentationRegistry.getArguments();
         mIterationCount = Integer.parseInt(mArgs.getString(KEY_ITERATION_COUNT,
                 Integer.toString(DEFAULT_ITERATION_COUNT)));