From 649475ac0a223877f7a8bcb1b82ceed70bd09ad7 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 Merged-In: I562246c1995365308d26f44683f75bf5c46b7405 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); }