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
This commit is contained in:
Brad Ebinger
2019-04-02 16:01:59 -07:00
parent a49f1b725f
commit 649475ac0a

View File

@@ -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);
}