Last active
December 15, 2017 17:40
-
-
Save martinomburajr/549d881dbf0f1357cfb6beba66ae9cf3 to your computer and use it in GitHub Desktop.
The Activity Threads main method
This file contains hidden or 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
| /** | |
| * Code retrieved from https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityThread.java | |
| * Modifications are indicated in the comments | |
| */ | |
| public static void main(String[] args) { | |
| //Modification - Removed unrelated initializers. | |
| //Android initializes some tracers, event loggers, enviroment initializers, trusted certificates and updates the process' state | |
| Looper.prepareMainLooper(); | |
| ActivityThread thread = new ActivityThread(); | |
| thread.attach(false); | |
| if (sMainThreadHandler == null) { | |
| sMainThreadHandler = thread.getHandler(); | |
| } | |
| // More logging | |
| // End of event ActivityThreadMain. | |
| Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); | |
| Looper.loop(); | |
| throw new RuntimeException("Main thread loop unexpectedly exited"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment