summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-09-27 12:00:09 -0700
committervadimt <vadimt@google.com>2019-09-27 12:00:09 -0700
commit2611d79f69a5d9250c90db0d57fea6fda84ab105 (patch)
tree28325be944ccf2e92a974832c8714455950d02a9
parent7028b10c547445f0ea05ce395edc54944e93a6a7 (diff)
downloadpackages_apps_Trebuchet-2611d79f69a5d9250c90db0d57fea6fda84ab105.tar.gz
packages_apps_Trebuchet-2611d79f69a5d9250c90db0d57fea6fda84ab105.tar.bz2
packages_apps_Trebuchet-2611d79f69a5d9250c90db0d57fea6fda84ab105.zip
Deprecating LauncherInstrumentation constructor with parameter
Change-Id: I779b4a8fde2db73cced8133f12d1356ad0b8729e
-rw-r--r--quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java2
-rw-r--r--tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java3
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java10
3 files changed, 12 insertions, 3 deletions
diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
index b8c00e434..8c11c1c2c 100644
--- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
+++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
@@ -79,7 +79,7 @@ public class FallbackRecentsTest {
Context context = instrumentation.getContext();
mDevice = UiDevice.getInstance(instrumentation);
mDevice.setOrientationNatural();
- mLauncher = new LauncherInstrumentation(instrumentation);
+ mLauncher = new LauncherInstrumentation();
mOrderSensitiveRules = RuleChain.
outerRule(new NavigationModeSwitchRule(mLauncher)).
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 1f4ba1af0..b20fae431 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -92,8 +92,7 @@ public abstract class AbstractLauncherUiTest {
protected MainThreadExecutor mMainThreadExecutor = new MainThreadExecutor();
protected final UiDevice mDevice = UiDevice.getInstance(getInstrumentation());
- protected final LauncherInstrumentation mLauncher =
- new LauncherInstrumentation(getInstrumentation());
+ protected final LauncherInstrumentation mLauncher = new LauncherInstrumentation();
protected Context mTargetContext;
protected String mTargetPackage;
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 1c8f92e91..49d7c7989 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -51,6 +51,7 @@ import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.test.InstrumentationRegistry;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.Configurator;
@@ -144,6 +145,15 @@ public final class LauncherInstrumentation {
/**
* Constructs the root of TAPL hierarchy. You get all other objects from it.
*/
+ public LauncherInstrumentation() {
+ this(InstrumentationRegistry.getInstrumentation());
+ }
+
+ /**
+ * Constructs the root of TAPL hierarchy. You get all other objects from it.
+ * Deprecated: use the constructor without parameters instead.
+ */
+ @Deprecated
public LauncherInstrumentation(Instrumentation instrumentation) {
mInstrumentation = instrumentation;
mDevice = UiDevice.getInstance(instrumentation);