From 9b7b91f8903ed6a8111bd7cccd24187a75400d42 Mon Sep 17 00:00:00 2001 From: Omooo <869759698@qq.com> Date: Fri, 22 May 2020 16:16:50 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Service=20=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=BF=87=E7=A8=8B.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service 组件的启动过程.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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; + } } ```