diff options
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/satellite/SatelliteManager.java | 83 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 15 |
2 files changed, 98 insertions, 0 deletions
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); } |