Search in sources :

Example 1 with ImsFeature

use of android.telephony.ims.feature.ImsFeature in project platform_frameworks_base by android.

the class ImsService method onRemoveImsFeatureInternal.

/**
     * Called from the ImsResolver to remove an existing ImsFeature, as defined by the slot and
     * featureType.
     * @param slotId An integer representing which SIM slot the ImsFeature is assigned to.
     * @param featureType An integer representing the type of ImsFeature being removed. This is
     * defined in {@link ImsFeature}.
     */
// Be sure to lock on mFeatures before accessing this method
private void onRemoveImsFeatureInternal(int slotId, int featureType) {
    SparseArray<ImsFeature> featureMap = mFeatures.get(slotId);
    if (featureMap == null) {
        return;
    }
    ImsFeature featureToRemove = getImsFeatureFromType(featureMap, featureType);
    if (featureToRemove != null) {
        featureMap.remove(featureType);
        featureToRemove.notifyFeatureRemoved(slotId);
        // Remove reference to Binder
        featureToRemove.setImsFeatureStatusCallback(null);
    }
}
Also used : ImsFeature(android.telephony.ims.feature.ImsFeature)

Example 2 with ImsFeature

use of android.telephony.ims.feature.ImsFeature in project platform_frameworks_base by android.

the class ImsService method onCreateImsFeatureInternal.

/**
     * Called from the ImsResolver to create the requested ImsFeature, as defined by the slot and
     * featureType
     * @param slotId An integer representing which SIM slot the ImsFeature is assigned to.
     * @param featureType An integer representing the type of ImsFeature being created. This is
     * defined in {@link ImsFeature}.
     */
// Be sure to lock on mFeatures before accessing this method
private void onCreateImsFeatureInternal(int slotId, int featureType, IImsFeatureStatusCallback c) {
    SparseArray<ImsFeature> featureMap = mFeatures.get(slotId);
    if (featureMap == null) {
        featureMap = new SparseArray<>();
        mFeatures.put(slotId, featureMap);
    }
    ImsFeature f = makeImsFeature(slotId, featureType);
    if (f != null) {
        f.setContext(this);
        f.setSlotId(slotId);
        f.setImsFeatureStatusCallback(c);
        featureMap.put(featureType, f);
    }
}
Also used : ImsFeature(android.telephony.ims.feature.ImsFeature)

Example 3 with ImsFeature

use of android.telephony.ims.feature.ImsFeature in project platform_frameworks_base by android.

the class ImsService method resolveMMTelFeature.

// Be sure to lock on mFeatures before accessing this method
private MMTelFeature resolveMMTelFeature(int slotId, int featureType) {
    SparseArray<ImsFeature> features = getImsFeatureMap(slotId);
    MMTelFeature feature = null;
    if (features != null) {
        feature = resolveImsFeature(features, featureType, MMTelFeature.class);
    }
    return feature;
}
Also used : MMTelFeature(android.telephony.ims.feature.MMTelFeature) ImsFeature(android.telephony.ims.feature.ImsFeature)

Example 4 with ImsFeature

use of android.telephony.ims.feature.ImsFeature in project android_frameworks_opt_telephony by LineageOS.

the class ImsServiceTest method testCreateMMTelFeature.

@Test
@SmallTest
public void testCreateMMTelFeature() throws RemoteException {
    IImsMmTelFeature f = mTestImsServiceBinder.createMmTelFeature(TEST_SLOT_0, mTestCallback);
    mTestImsService.mTestMmTelFeature.sendSetFeatureState(ImsFeature.STATE_READY);
    SparseArray<ImsFeature> features = mTestImsService.getFeatures(TEST_SLOT_0);
    ImsFeature featureToVerify = features.get(ImsFeature.FEATURE_MMTEL);
    MmTelFeature testMMTelFeature = null;
    if (featureToVerify instanceof MmTelFeature) {
        testMMTelFeature = (MmTelFeature) featureToVerify;
    } else {
        fail();
    }
    assertEquals(mTestImsService.mSpyMmTelFeature, testMMTelFeature);
    // Verify that upon creating a feature, we assign the callback and get the set feature state
    // when querying it.
    verify(mTestImsService.mSpyMmTelFeature).addImsFeatureStatusCallback(eq(mTestCallback));
    assertEquals(ImsFeature.STATE_READY, f.getFeatureState());
}
Also used : ImsFeature(android.telephony.ims.feature.ImsFeature) IImsMmTelFeature(android.telephony.ims.aidl.IImsMmTelFeature) IImsMmTelFeature(android.telephony.ims.aidl.IImsMmTelFeature) MmTelFeature(android.telephony.ims.feature.MmTelFeature) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

ImsFeature (android.telephony.ims.feature.ImsFeature)4 IImsMmTelFeature (android.telephony.ims.aidl.IImsMmTelFeature)1 MMTelFeature (android.telephony.ims.feature.MMTelFeature)1 MmTelFeature (android.telephony.ims.feature.MmTelFeature)1 SmallTest (android.test.suitebuilder.annotation.SmallTest)1 Test (org.junit.Test)1