From 5226c685463a022d3666b64047071d49667b570a Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Tue, 2 Apr 2019 16:01:59 -0700 Subject: [PATCH] Reorder ImsFeature initialization to handle STATE_READY The method ImsFeature#setFeatureState can not be called in the constructor of MmTelFeature currently, because the IMS_SERVICE_UP intent will not be sent until mContext != null. Remove this dependency and ensure addImsFeatureStatusCallback is called after ImsFeature#initialize. Bug: 130569556 Test: atest GtsTelephonyTestCases; atest FrameworksTelephonyTests Change-Id: Ib3ca59eeeda89c0989cfd767257a6a598a97a670 --- telephony/java/android/telephony/ims/ImsService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/ims/ImsService.java b/telephony/java/android/telephony/ims/ImsService.java index c008711ff2366..e6777c17203aa 100644 --- a/telephony/java/android/telephony/ims/ImsService.java +++ b/telephony/java/android/telephony/ims/ImsService.java @@ -40,8 +40,6 @@ import android.util.SparseArray; import com.android.ims.internal.IImsFeatureStatusCallback; import com.android.internal.annotations.VisibleForTesting; -import static android.Manifest.permission.MODIFY_PHONE_STATE; - /** * Main ImsService implementation, which binds via the Telephony ImsResolver. Services that extend * ImsService must register the service in their AndroidManifest to be detected by the framework. @@ -229,8 +227,8 @@ public class ImsService extends Service { private void setupFeature(ImsFeature f, int slotId, int featureType, IImsFeatureStatusCallback c) { - f.addImsFeatureStatusCallback(c); f.initialize(this, slotId); + f.addImsFeatureStatusCallback(c); addImsFeature(slotId, featureType, f); }