Merge "[Thread] start / initialize Thread service early" into main am: 79e3b59358

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2899288

Change-Id: I4257a62fcb212dcf28c70d7bc97d33341a91ad2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Kangping Dong 2024-01-08 13:39:22 +00:00 • committed by Automerger Merge Worker
commit 88710362f1

View file

@ -48,17 +48,20 @@ public class ThreadNetworkService extends IThreadNetworkManager.Stub {
}
/**
* Called by the service initializer.
* Called by {@link com.android.server.ConnectivityServiceInitializer}.
*
* @see com.android.server.SystemService#onBootPhase
*/
public void onBootPhase(int phase) {
if (phase == SystemService.PHASE_BOOT_COMPLETED) {
if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
mControllerService = ThreadNetworkControllerService.newInstance(mContext);
mControllerService.initialize();
} else if (phase == SystemService.PHASE_BOOT_COMPLETED) {
// Country code initialization is delayed to the BOOT_COMPLETED phase because it will
// call into Wi-Fi and Telephony service whose country code module is ready after
// PHASE_ACTIVITY_MANAGER_READY and PHASE_THIRD_PARTY_APPS_CAN_START
mCountryCode = ThreadNetworkCountryCode.newInstance(mContext, mControllerService);
mCountryCode.initialize();
mShellCommand = new ThreadNetworkShellCommand(mCountryCode);
}
}