Default [Q] SMS Processing


i have a question about the sms processing in android.
Does anybody know how the sms processing looks like in android? I know there is an api to write sms applications, but i didn't find anything in the documentation what happens before the sms reaches the sms application, but i am interested in this.

It would be nice if somebody could explain this or could show me where i have to read in the documentation.

I'm looking for this for android 4.1/4.2.