On Tue, Dec 2, 2014 at 3:15 PM, si perdana <cperd...@gmail.com> wrote:

> 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 here:

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/froyo-release/services/java/com/android/server/am/ActivityManagerService.java

we know ActivityManagerService is started early in the Android bootup
stage.   And here has good internals about AMS:

http://blog.csdn.net/windskier/article/details/7096521

(see diagram, it organized all activities in an array list for management).

After that "registerReceiver" is an Intent (see the code above), how it
worked (not your main concern here) is here:

http://stackoverflow.com/questions/22195689/how-does-intent-filter-work-in-android


> but for accessing registerReceiver, you need a "context", and the
speciific intent:

http://stackoverflow.com/questions/13808311/accessing-android-context-from-java-service

http://stackoverflow.com/questions/16222320/blocking-particular-apps-in-android-by-modifying-source-code

So if you can identify the specific context and intent involved, you have
to link to how AMS.registerReceiver() are reached.

Logical?

>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.
>
> --
> --
> unsubscribe: android-kernel+unsubscr...@googlegroups.com
> website: http://groups.google.com/group/android-kernel
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Linux Kernel Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-kernel+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards,
Peter Teoh

-- 
-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel
--- 
You received this message because you are subscribed to the Google Groups 
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-kernel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to