Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

java - Where is AOSP surfaceflinger initiated?

SurfaceFlinger is essential in Android graphics rendering. I ve researched and found some code about surfaceflinger. This is its main: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-11.0.0_r28/services/surfaceflinger/main_surfaceflinger.cpp

I couldnt find anything related to starting surfaceflinger on init.rc: https://android.googlesource.com/platform/system/core/+/refs/tags/android-11.0.0_r28/rootdir/init.rc

I ve found here: https://proandroiddev.com/how-android-boot-up-9864376d911c that surfaceflinger is started by SystemServer. So I found SystemServer source code here: https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-11.0.0_r28/services/java/com/android/server/SystemServer.java but I saw no mention of SurfaceFlinger/surfaceflinger or Surface Flinger

There is a surfaceflinger.rc file in the Surface Flinger directory but I couldn t find any file that includes it: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-11.0.0_r28/services/surfaceflinger/surfaceflinger.rc

Where is the surfaceflinger service started in Android?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is a surfaceflinger.rc file in the Surface Flinger directory but I couldn t find any file that includes it: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-11.0.0_r28/services/surfaceflinger/surfaceflinger.rc

It is here: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-11.0.0_r28/services/surfaceflinger/Android.bp#253 init_rc:["surfaceflinger.rc"]:

cc_binary {
    name: "surfaceflinger",
    defaults: ["libsurfaceflinger_binary"],
    init_rc: ["surfaceflinger.rc"],
    srcs: [":surfaceflinger_binary_sources"],
    shared_libs: [
        "libsurfaceflinger",
        "libSurfaceFlingerProp",
    ],
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...