diff options
3 files changed, 11 insertions, 12 deletions
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java index 24950e65c174..afa7a6c51abb 100644 --- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java +++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java @@ -225,14 +225,9 @@ public class RavenwoodRuntimeEnvironmentController { ActivityManager.init$ravenwood(config.mCurrentUser); - final HandlerThread main; - if (config.mProvideMainThread) { - main = new HandlerThread(MAIN_THREAD_NAME); - main.start(); - Looper.setMainLooperForTest(main.getLooper()); - } else { - main = null; - } + final var main = new HandlerThread(MAIN_THREAD_NAME); + main.start(); + Looper.setMainLooperForTest(main.getLooper()); final boolean isSelfInstrumenting = Objects.equals(config.mTestPackageName, config.mTargetPackageName); @@ -324,10 +319,8 @@ public class RavenwoodRuntimeEnvironmentController { } sMockUiAutomation.dropShellPermissionIdentity(); - if (config.mProvideMainThread) { - Looper.getMainLooper().quit(); - Looper.clearMainLooperForTest(); - } + Looper.getMainLooper().quit(); + Looper.clearMainLooperForTest(); ActivityManager.reset$ravenwood(); diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java index 446f819ad41b..1f6e11dd5cf2 100644 --- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java +++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java @@ -152,7 +152,10 @@ public final class RavenwoodConfig { /** * Configure a "main" thread to be available for the duration of the test, as defined * by {@code Looper.getMainLooper()}. Has no effect on non-Ravenwood environments. + * + * @deprecated */ + @Deprecated public Builder setProvideMainThread(boolean provideMainThread) { mConfig.mProvideMainThread = provideMainThread; return this; diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java index 4196d8e22610..93a6806ed1f4 100644 --- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java +++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java @@ -139,7 +139,10 @@ public final class RavenwoodRule implements TestRule { /** * Configure a "main" thread to be available for the duration of the test, as defined * by {@code Looper.getMainLooper()}. Has no effect on non-Ravenwood environments. + * + * @deprecated */ + @Deprecated public Builder setProvideMainThread(boolean provideMainThread) { mBuilder.setProvideMainThread(provideMainThread); return this; |