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 @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
33 public interface SatelliteTransmissionUpdateCallback {
34     /**
35      * Called when the satellite position changed.
36      *
37      * @param pointingInfo The pointing info containing the satellite location.
38      */
39     @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
onSatellitePositionChanged(@onNull PointingInfo pointingInfo)40     void onSatellitePositionChanged(@NonNull PointingInfo pointingInfo);
41 
42     /**
43      * Called when satellite datagram send state changed.
44      *
45      * @param state The new send datagram transfer state.
46      * @param sendPendingCount The number of datagrams that are currently being sent.
47      * @param errorCode If datagram transfer failed, the reason for failure.
48      */
49     @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
onSendDatagramStateChanged( @atelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount, @SatelliteManager.SatelliteResult int errorCode)50     void onSendDatagramStateChanged(
51             @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount,
52             @SatelliteManager.SatelliteResult int errorCode);
53 
54     /**
55      * Called when satellite datagram send state changed.
56      *
57      * @param datagramType The datagram type of currently being sent.
58      * @param state The new send datagram transfer state.
59      * @param sendPendingCount The number of datagrams that are currently being sent.
60      * @param errorCode If datagram transfer failed, the reason for failure.
61      *
62      * @hide
63      */
onSendDatagramStateChanged(@atelliteManager.DatagramType int datagramType, @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount, @SatelliteManager.SatelliteResult int errorCode)64     void onSendDatagramStateChanged(@SatelliteManager.DatagramType int datagramType,
65             @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount,
66             @SatelliteManager.SatelliteResult int errorCode);
67     /**
68      * Called when satellite datagram receive state changed.
69      *
70      * @param state The new receive datagram transfer state.
71      * @param receivePendingCount The number of datagrams that are currently pending to be received.
72      * @param errorCode If datagram transfer failed, the reason for failure.
73      */
74     @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
onReceiveDatagramStateChanged( @atelliteManager.SatelliteDatagramTransferState int state, int receivePendingCount, @SatelliteManager.SatelliteResult int errorCode)75     void onReceiveDatagramStateChanged(
76             @SatelliteManager.SatelliteDatagramTransferState int state, int receivePendingCount,
77             @SatelliteManager.SatelliteResult int errorCode);
78 }
79