1 /*
2  * Copyright (c) 2013 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.internal;
18 
19 
20 
21 /**
22  * Provides the APIs to control the media session, such as passing the surface object,
23  * controlling the camera (front/rear selection, zoom, brightness, ...) for a video calling.
24  *
25  * @hide
26  */
27 public class ImsStreamMediaSession {
28     private static final String TAG = "ImsStreamMediaSession";
29 
30     /**
31      * Listener for events relating to an IMS media session.
32      * <p>Many of these events are also received by {@link ImsStreamMediaSession.Listener}.</p>
33      */
34     public static class Listener {
35     }
36 
37     private Listener mListener;
38 
ImsStreamMediaSession(IImsStreamMediaSession mediaSession)39     ImsStreamMediaSession(IImsStreamMediaSession mediaSession) {
40     }
41 
ImsStreamMediaSession(IImsStreamMediaSession mediaSession, Listener listener)42     ImsStreamMediaSession(IImsStreamMediaSession mediaSession, Listener listener) {
43         this(mediaSession);
44         setListener(listener);
45     }
46 
47     /**
48      * Sets the listener to listen to the media session events. A {@code ImsStreamMediaSession}
49      * can only hold one listener at a time. Subsequent calls to this method
50      * override the previous listener.
51      *
52      * @param listener to listen to the media session events of this object
53      */
setListener(Listener listener)54     public void setListener(Listener listener) {
55         mListener = listener;
56     }
57 }
58