1 /* 2 * Copyright (C) 2021 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.internal.telephony.data; 18 19 import android.annotation.NonNull; 20 import android.net.NetworkAgent; 21 import android.net.QosSessionAttributes; 22 23 /** 24 * The temporary interface that is shared by 25 * {@link com.android.internal.telephony.dataconnection.DcNetworkAgent} and 26 * {@link com.android.internal.telephony.data.TelephonyNetworkAgent} so they can both interact 27 * with {@link QosCallbackTracker}. 28 */ 29 // TODO: Remove after DcNetworkAgent is removed. 30 public interface NotifyQosSessionInterface { 31 /** 32 * Sends the attributes of Qos Session back to the Application. This method is create for 33 * Mockito to mock since 34 * {@link NetworkAgent#sendQosSessionAvailable(int, int, QosSessionAttributes)} is 35 * {@code final} that can't be mocked. 36 * 37 * @param qosCallbackId the callback id that the session belongs to. 38 * @param sessionId the unique session id across all Qos Sessions. 39 * @param attributes the attributes of the Qos Session. 40 */ notifyQosSessionAvailable(int qosCallbackId, int sessionId, @NonNull QosSessionAttributes attributes)41 void notifyQosSessionAvailable(int qosCallbackId, int sessionId, 42 @NonNull QosSessionAttributes attributes); 43 44 /** 45 * Sends event that the Qos Session was lost. This method is create for Mockito to mock 46 * since {@link NetworkAgent#sendQosSessionLost(int, int, int)} is {@code final} that can't be 47 * mocked.. 48 * 49 * @param qosCallbackId the callback id that the session belongs to. 50 * @param sessionId the unique session id across all Qos Sessions. 51 * @param qosSessionType the session type {@code QosSession#QosSessionType}. 52 */ notifyQosSessionLost(int qosCallbackId, int sessionId, int qosSessionType)53 void notifyQosSessionLost(int qosCallbackId, int sessionId, int qosSessionType); 54 } 55