diff --git a/blogs/Android/Framework/源代码情景分析/四大组件的启动过程/Service 组件的启动过程.md b/blogs/Android/Framework/源代码情景分析/四大组件的启动过程/Service 组件的启动过程.md index 0e0b976..7743fec 100644 --- a/blogs/Android/Framework/源代码情景分析/四大组件的启动过程/Service 组件的启动过程.md +++ b/blogs/Android/Framework/源代码情景分析/四大组件的启动过程/Service 组件的启动过程.md @@ -229,7 +229,23 @@ static final class ServiceDispatcher { private final Handler mActivityThread; private final Context mContext; - private static class InnerConnection extends + private static class InnerConnection extends IServiceConnection.Stub { + fianl WeakReference mDispatcher; + InnerConnection(LoadedApk.ServiceDispatcher sd) { + mDispatcher = new WeakReference<>(sd); + } + } + + ServiceDispatcher(ServiceConnection conn, Context context, Handler activityThread, int flags) { + mIServiceConnection = new InnerConnection(this); + mConnection = conn; + mContext = context; + mActivityThread = activityThread; + } + + IServiceConnection getIServiceConnection() { + return mIServiceConnection; + } } ```