Refactor hostingType/hostingName/hostingNameStr.
These are parameters to various startProcess calls, and have been overloaded to mean different things. In most cases, the hostingType describes why we asked to start the process, or what type of component we were starting it for; examples: "content provider", "service". But, it is also used to indicate that a process should use either the Webview or Application zygote, eg "webview_zygote". In some cases (eg for the system process), it can be null. The hostingName parameter is a ComponentName, which is the component we are intending to host in the process. There are also instances where we take a String instead of a ComponentName. This parameter is actually only used for logging purposes, and doesn't really have any functional effects. To that end, introduce a new HostingRecord class to be used in the startProcess() calls, which replaces the previous hostingType/hostingName/hostingNameStr paramaters. It removes the "zygote" overload and makes that explicit, and directly converts the ComponentName to a String (since that is the only representation of it that is used anyway). The main reason to do this refactor now is that we need to have some more information when starting a process for a BIND_EXTERNAL service that use the application zygote; adding yet another parameter to startProcess() didn't seem like the right way to go. In the future, more information can be moved into this class, in order to clean up the startProcess(...) calls, which have become rather complicated. Bug: 127820394 Test: Device boots Change-Id: I6569bb4533ea829071e8715b7f22df918009dd08
Loading
Please register or sign in to comment