diff options
author | 2025-03-18 15:53:56 -0700 | |
---|---|---|
committer | 2025-03-18 15:53:56 -0700 | |
commit | c6b09aa74ce6210b9eb65a0974fd20bdb25156c9 (patch) | |
tree | 2138d2ee05eccae803044017b3433ada2922c7e7 | |
parent | 267710536f781d14b922362e9a22636189b17b9d (diff) | |
parent | 421a4ab71bbec3511abd98da77de55e95adcc11f (diff) |
Merge "adding api for getSatelliteDataMode" into main
-rw-r--r-- | core/api/system-current.txt | 5 | ||||
-rw-r--r-- | telephony/java/android/telephony/satellite/SatelliteManager.java | 83 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 15 |
3 files changed, 103 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 95b9b49dae3d..42c60b0ba0da 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -18628,6 +18628,7 @@ package android.telephony.satellite { method @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void deprovisionService(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>); method @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.Set<java.lang.Integer> getAttachRestrictionReasonsForCarrier(int); method @FlaggedApi("com.android.internal.telephony.flags.satellite_25q4_apis") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.List<java.lang.String> getSatelliteDataOptimizedApps(); + method @FlaggedApi("com.android.internal.telephony.flags.satellite_25q4_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int getSatelliteDataSupportMode(int); method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int[] getSatelliteDisallowedReasons(); method @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.List<java.lang.String> getSatellitePlmnsForCarrier(int); method @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void pollPendingDatagrams(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>); @@ -18710,6 +18711,10 @@ package android.telephony.satellite { field public static final int SATELLITE_DATAGRAM_TRANSFER_STATE_SEND_SUCCESS = 2; // 0x2 field public static final int SATELLITE_DATAGRAM_TRANSFER_STATE_UNKNOWN = -1; // 0xffffffff field public static final int SATELLITE_DATAGRAM_TRANSFER_STATE_WAITING_TO_CONNECT = 8; // 0x8 + field @FlaggedApi("com.android.internal.telephony.flags.satellite_25q4_apis") public static final int SATELLITE_DATA_SUPPORT_CONSTRAINED = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.satellite_25q4_apis") public static final int SATELLITE_DATA_SUPPORT_RESTRICTED = 0; // 0x0 + field @FlaggedApi("com.android.internal.telephony.flags.satellite_25q4_apis") public static final int SATELLITE_DATA_SUPPORT_UNCONSTRAINED = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.satellite_25q4_apis") public static final int SATELLITE_DATA_SUPPORT_UNKNOWN = -1; // 0xffffffff field public static final int SATELLITE_MODEM_STATE_CONNECTED = 7; // 0x7 field public static final int SATELLITE_MODEM_STATE_DATAGRAM_RETRYING = 3; // 0x3 field public static final int SATELLITE_MODEM_STATE_DATAGRAM_TRANSFERRING = 2; // 0x2 diff --git a/telephony/java/android/telephony/satellite/SatelliteManager.java b/telephony/java/android/telephony/satellite/SatelliteManager.java index 270d599e0a0a..6b4b0ee93684 100644 --- a/telephony/java/android/telephony/satellite/SatelliteManager.java +++ b/telephony/java/android/telephony/satellite/SatelliteManager.java @@ -700,6 +700,56 @@ public final class SatelliteManager { public @interface DisplayMode {} /** + * Unknown or unsupported value for data mode on satellite. + * @hide + */ + @SystemApi + @FlaggedApi(Flags.FLAG_SATELLITE_25Q4_APIS) + public static final int SATELLITE_DATA_SUPPORT_UNKNOWN = -1; + + /** + * Support only restricted data usecases like carrier messaging using RCS. + * @hide + */ + @SystemApi + @FlaggedApi(Flags.FLAG_SATELLITE_25Q4_APIS) + public static final int SATELLITE_DATA_SUPPORT_RESTRICTED = 0; + + /** + * Support constrained internet which would enable internet only for applications that are + * modified. + * + * <p> + * To get internet access, applications need to be modified to use the satellite data + * optimized network. This can be done by setting the {@link #PROPERTY_SATELLITE_DATA_OPTIMIZED} + * property to {@code true} in the manifest. + * </p> + * + * @hide + */ + @SystemApi + @FlaggedApi(Flags.FLAG_SATELLITE_25Q4_APIS) + public static final int SATELLITE_DATA_SUPPORT_CONSTRAINED = 1; + + /** + * Support default internet on satellite without any restrictions on any apps. + * @hide + */ + @SystemApi + @FlaggedApi(Flags.FLAG_SATELLITE_25Q4_APIS) + public static final int SATELLITE_DATA_SUPPORT_UNCONSTRAINED = 2; + + /** @hide */ + @IntDef(prefix = {"SATELLITE_DATA_SUPPORT_"}, value = { + SATELLITE_DATA_SUPPORT_UNKNOWN, + SATELLITE_DATA_SUPPORT_RESTRICTED, + SATELLITE_DATA_SUPPORT_CONSTRAINED, + SATELLITE_DATA_SUPPORT_UNCONSTRAINED, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface SatelliteDataSupportMode {} + + /** * The emergency call is handed over to oem-enabled satellite SOS messaging. SOS messages are * sent to SOS providers, which will then forward the messages to emergency providers. * @hide @@ -3788,6 +3838,39 @@ public final class SatelliteManager { return appsNames; } + /** + * Method to return the current satellite data service policy supported mode for the + * subscriptionId based on carrier config. + * + * @param subId current subscription id. + * + * @return Supported modes {@link SatelliteDataSupportMode} + * @throws IllegalArgumentException if the subscription is invalid. + * + * @hide + */ + @SystemApi + @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) + @FlaggedApi(Flags.FLAG_SATELLITE_25Q4_APIS) + @SatelliteDataSupportMode + public int getSatelliteDataSupportMode(int subId) { + int satelliteMode = SATELLITE_DATA_SUPPORT_UNKNOWN; + + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + satelliteMode = telephony.getSatelliteDataSupportMode(subId); + } else { + throw new IllegalStateException("telephony service is null."); + } + } catch (RemoteException ex) { + loge("getSatelliteDataSupportMode() RemoteException:" + ex); + ex.rethrowAsRuntimeException(); + } + + return satelliteMode; + } + @Nullable private static ITelephony getITelephony() { ITelephony binder = ITelephony.Stub.asInterface(TelephonyFrameworkInitializer diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index b8aa9e8646bd..d7f80a94081a 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -3641,4 +3641,19 @@ interface ITelephony { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(" + "android.Manifest.permission.SATELLITE_COMMUNICATION)") List<String> getSatelliteDataOptimizedApps(); + + /** + * Method to return the current satellite data service policy supported mode for the + * subscriptionId based on subscription id. Note: Iif any error or invalid sub id + * {@Link SatelliteDataSupportMode#SATELLITE_DATA_SUPPORT_UNKNOWN} will be returned. + * + * @param subId current subscription id. + * + * @return Supported modes {@link SatelliteDataSupportMode} + * @throws IllegalArgumentException if the subscription is invalid. + * @hide + */ + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(" + + "android.Manifest.permission.SATELLITE_COMMUNICATION)") + int getSatelliteDataSupportMode(in int subId); } |