File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
src/main/java/io/reactivex/rxjava3/android/schedulers Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ android {
1212 sourceCompatibility rootProject. ext. sourceCompatibility
1313 targetCompatibility rootProject. ext. sourceCompatibility
1414 }
15+
16+ testOptions {
17+ unitTests. returnDefaultValues = true
18+ }
1519}
1620
1721dependencies {
Original file line number Diff line number Diff line change 2525public final class AndroidSchedulers {
2626
2727 private static final class MainHolder {
28- static final Scheduler DEFAULT
29- = from (Looper .getMainLooper ());
28+ static final Scheduler DEFAULT = internalFrom (Looper .getMainLooper (), true );
3029 }
3130
3231 private static final Scheduler MAIN_THREAD =
@@ -61,10 +60,13 @@ public static Scheduler from(Looper looper) {
6160 * locking. On API < 16 this value is ignored.
6261 * @see Message#setAsynchronous(boolean)
6362 */
64- @ SuppressLint ("NewApi" ) // Checking for an @hide API.
6563 public static Scheduler from (Looper looper , boolean async ) {
6664 if (looper == null ) throw new NullPointerException ("looper == null" );
65+ return internalFrom (looper , async );
66+ }
6767
68+ @ SuppressLint ("NewApi" ) // Checking for an @hide API.
69+ private static Scheduler internalFrom (Looper looper , boolean async ) {
6870 // Below code exists in androidx-core as well, but is left here rather than include an
6971 // entire extra dependency.
7072 // https://developer.android.com/reference/kotlin/androidx/core/os/MessageCompat?hl=en#setAsynchronous(android.os.Message,%20kotlin.Boolean)
You can’t perform that action at this time.
0 commit comments