1 /* 2 * Copyright (C) 2023 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 android.telephony.satellite; 18 19 import android.annotation.FlaggedApi; 20 import android.annotation.NonNull; 21 import android.annotation.SystemApi; 22 23 import com.android.internal.telephony.flags.Flags; 24 25 /** 26 * A callback class for monitoring satellite position update and datagram transfer state change 27 * events. 28 * 29 * @hide 30 */ 31 @SystemApi 32 public interface SatelliteTransmissionUpdateCallback { 33 /** 34 * Called when the satellite position changed. 35 * 36 * @param pointingInfo The pointing info containing the satellite location. 37 */ onSatellitePositionChanged(@onNull PointingInfo pointingInfo)38 void onSatellitePositionChanged(@NonNull PointingInfo pointingInfo); 39 40 /** 41 * Called when satellite datagram send state changed. 42 * 43 * @param state The new send datagram transfer state. 44 * @param sendPendingCount The number of datagrams that are currently being sent. 45 * @param errorCode If datagram transfer failed, the reason for failure. 46 */ onSendDatagramStateChanged( @atelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount, @SatelliteManager.SatelliteResult int errorCode)47 void onSendDatagramStateChanged( 48 @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount, 49 @SatelliteManager.SatelliteResult int errorCode); 50 51 /** 52 * Called when satellite datagram send state changed. 53 * 54 * @param datagramType The datagram type of currently being sent. 55 * @param state The new send datagram transfer state. 56 * @param sendPendingCount The number of datagrams that are currently being sent. 57 * @param errorCode If datagram transfer failed, the reason for failure. 58 */ 59 @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS) onSendDatagramStateChanged(@atelliteManager.DatagramType int datagramType, @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount, @SatelliteManager.SatelliteResult int errorCode)60 default void onSendDatagramStateChanged(@SatelliteManager.DatagramType int datagramType, 61 @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount, 62 @SatelliteManager.SatelliteResult int errorCode) {} 63 /** 64 * Called when satellite datagram receive state changed. 65 * 66 * @param state The new receive datagram transfer state. 67 * @param receivePendingCount The number of datagrams that are currently pending to be received. 68 * @param errorCode If datagram transfer failed, the reason for failure. 69 */ onReceiveDatagramStateChanged( @atelliteManager.SatelliteDatagramTransferState int state, int receivePendingCount, @SatelliteManager.SatelliteResult int errorCode)70 void onReceiveDatagramStateChanged( 71 @SatelliteManager.SatelliteDatagramTransferState int state, int receivePendingCount, 72 @SatelliteManager.SatelliteResult int errorCode); 73 74 /** 75 * Called when framework receives a request to send a datagram. 76 * 77 * Informs external apps that device is working on sending a datagram out and is in the process 78 * of checking if all the conditions required to send datagrams are met. 79 * 80 * @param datagramType The type of the requested datagram. 81 */ 82 @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS) onSendDatagramRequested(@atelliteManager.DatagramType int datagramType)83 default void onSendDatagramRequested(@SatelliteManager.DatagramType int datagramType) {} 84 } 85