1 /* 2 * Copyright (c) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ims; 18 19 import android.telephony.ims.ImsService; 20 import android.telephony.ims.feature.ImsFeature; 21 22 import com.android.ims.internal.IImsServiceFeatureCallback; 23 24 /** 25 * Interface used by Manager interfaces that will use a {@link FeatureConnector} to connect to 26 * remote ImsFeature Binder interfaces. 27 */ 28 public interface FeatureUpdates { 29 /** 30 * Register a callback for the slot specified so that the FeatureConnector can notify its 31 * listener of changes. 32 * @param slotId The slot the callback is registered for. 33 * @param cb The callback that the FeatureConnector will use to update its state and notify 34 * its callback of changes. 35 */ registerFeatureCallback(int slotId, IImsServiceFeatureCallback cb)36 void registerFeatureCallback(int slotId, IImsServiceFeatureCallback cb); 37 38 /** 39 * Unregister a previously registered callback due to the FeatureConnector disconnecting. 40 * <p> 41 * This does not need to be called if the callback was previously registered for a one 42 * shot result. 43 * @param cb The callback to unregister. 44 */ unregisterFeatureCallback(IImsServiceFeatureCallback cb)45 void unregisterFeatureCallback(IImsServiceFeatureCallback cb); 46 47 /** 48 * Associate this Manager instance with the IMS Binder interfaces specified. This is usually 49 * done by creating a FeatureConnection instance with these interfaces. 50 * @param container Contains all of the related interfaces attached to a specific ImsFeature. 51 * @param subId The subscription ID that the IMS Feature is being created for. 52 */ associate(ImsFeatureContainer container, int subId)53 void associate(ImsFeatureContainer container, int subId); 54 55 /** 56 * Invalidate the previously associated Binder interfaces set in {@link #associate}. 57 */ invalidate()58 void invalidate(); 59 60 /** 61 * Update the state of the remote ImsFeature associated with this Manager instance. 62 */ updateFeatureState(@msFeature.ImsState int state)63 void updateFeatureState(@ImsFeature.ImsState int state); 64 65 /** 66 * Update the capabilities of the remove ImsFeature associated with this Manager instance. 67 */ updateFeatureCapabilities(@msService.ImsServiceCapability long capabilities)68 void updateFeatureCapabilities(@ImsService.ImsServiceCapability long capabilities); 69 }