I'm trying to trace registerReceiver() from Activity class to understand the process flow.
I'll believe the call will end up in ActivityManagerService.registerReceiver().
From my understanding, it should be involve a request to SystemService, since ActivityManagerService live in the SystemService. The problem, I cannot trace the code execution flow from Activity.java to ActivityManagerService.
From developer.android.com:
java.lang.Object
↳ android.content.Context
↳ android.content.ContextWrapper
↳ android.view.ContextThemeWrapper
↳ android.app.Activity
I've been looking all class above to trace the implementation of registerReceiver(), but can not locate the code that request the systemservice of ActivityManagerService.
Hope someone can explain how the ActivityManagerService is triggered.
Thank you.
Found the answer from google groups.
Since Activity and ContextThemeWrapper not implement registerReceiver(), it will reach ContextWrapper: