• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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.ImsExternalCallState;
20 
21 import java.util.List;
22 import java.util.concurrent.Executor;
23 
24 /**
25  * Listener for receiving notifications about {@link ImsExternalCallState} information received
26  * from the network via a dialog event package.
27  *
28  * @hide
29  */
30 public abstract class ImsExternalCallStateListener {
31     protected Executor mListenerExecutor = Runnable::run;
32     /**
33      * constructor.
34      *
35      * @param executor the executor that will execute callbacks.
36      */
ImsExternalCallStateListener(Executor executor)37     public ImsExternalCallStateListener(Executor executor) {
38         if (executor != null)
39             mListenerExecutor = executor;
40     }
41     /**
42      * Notifies client when Dialog Event Package update is received
43      *
44      * @param externalCallState the external call state.
45      */
onImsExternalCallStateUpdate(List<ImsExternalCallState> externalCallState)46     public final void onImsExternalCallStateUpdate(List<ImsExternalCallState> externalCallState) {
47         onImsExternalCallStateUpdate(externalCallState, mListenerExecutor);
48     }
49     /**
50      * Notifies client when Dialog Event Package update is received
51      *
52      * @param externalCallState the external call state.
53      *
54      * @param executor the executor that will execute callbacks.
55      */
onImsExternalCallStateUpdate( List<ImsExternalCallState> externalCallState, Executor executor)56     public abstract void onImsExternalCallStateUpdate(
57         List<ImsExternalCallState> externalCallState, Executor executor);
58 }
59