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);
}
}
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);
}
}
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;
}
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());
}
Aggregations