Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added fake-android module with fake android.os.Handler and Looper
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
apply plugin: 'java' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package android.os; | ||
|
||
/** | ||
* Pretends to be {@link android.os.Handler}. | ||
* Used as a {@code compileOnly} dependency to avoid reflection. | ||
*/ | ||
public class Handler { | ||
|
||
static { | ||
if (true) { | ||
throw new NoClassDefFoundError("this class in for compile-time only"); | ||
} | ||
} | ||
|
||
public Handler(Looper looper) { | ||
throw null; | ||
} | ||
|
||
public final boolean post(Runnable r) { | ||
throw null; | ||
} | ||
|
||
public final boolean postDelayed(Runnable r, long delayMillis) { | ||
throw null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package android.os; | ||
|
||
/** | ||
* Pretends to be {@link android.os.Looper}. | ||
* Used as a {@code compileOnly} dependency to avoid reflection. | ||
*/ | ||
public final class Looper { | ||
|
||
static { | ||
if (true) { | ||
throw new NoClassDefFoundError("this class in for compile-time only"); | ||
} | ||
} | ||
|
||
public static Looper myLooper() { | ||
throw null; | ||
} | ||
|
||
} |