Loading core/java/android/telephony/PhoneStateListener.java +4 −0 Original line number Diff line number Diff line Loading @@ -1689,6 +1689,10 @@ public class PhoneStateListener { public final void onCarrierRoamingNtnModeChanged(boolean active) { // not supported on the deprecated interface - Use TelephonyCallback instead } public final void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) { // not supported on the deprecated interface - Use TelephonyCallback instead } } private void log(String s) { Loading core/java/android/telephony/TelephonyCallback.java +51 −1 Original line number Diff line number Diff line Loading @@ -652,6 +652,27 @@ public class TelephonyCallback { */ public static final int EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED = 42; /** * Event for listening to changes in carrier roaming non-terrestrial network eligibility. * * @see CarrierRoamingNtnModeListener * * Device is eligible for satellite communication if all the following conditions are met: * <ul> * <li>Any subscription on the device supports P2P satellite messaging which is defined by * {@link CarrierConfigManager#KEY_SATELLITE_ATTACH_SUPPORTED_BOOL} </li> * <li>{@link CarrierConfigManager#KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT} set to * {@link CarrierConfigManager#CARRIER_ROAMING_NTN_CONNECT_MANUAL} </li> * <li>The device is in {@link ServiceState#STATE_OUT_OF_SERVICE}, not connected to Wi-Fi, * and the hysteresis timer defined by {@link CarrierConfigManager * #KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT} is expired. * </li> * </ul> * * @hide */ public static final int EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED = 43; /** * @hide */ Loading Loading @@ -697,7 +718,8 @@ public class TelephonyCallback { EVENT_MEDIA_QUALITY_STATUS_CHANGED, EVENT_EMERGENCY_CALLBACK_MODE_CHANGED, EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED, EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED, EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED }) @Retention(RetentionPolicy.SOURCE) public @interface TelephonyEvent { Loading Loading @@ -1711,6 +1733,23 @@ public class TelephonyCallback { * {code false} otherwise. */ void onCarrierRoamingNtnModeChanged(boolean active); /** * Callback invoked when carrier roaming non-terrestrial network eligibility changes. * * @param eligible {@code true} when the device is eligible for satellite * communication if all the following conditions are met: * <ul> * <li>Any subscription on the device supports P2P satellite messaging which is defined by * {@link CarrierConfigManager#KEY_SATELLITE_ATTACH_SUPPORTED_BOOL} </li> * <li>{@link CarrierConfigManager#KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT} set to * {@link CarrierConfigManager#CARRIER_ROAMING_NTN_CONNECT_MANUAL} </li> * <li>The device is in {@link ServiceState#STATE_OUT_OF_SERVICE}, not connected to Wi-Fi, * and the hysteresis timer defined by {@link CarrierConfigManager * #KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT} is expired. </li> * </ul> */ default void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) {} } /** Loading Loading @@ -2125,5 +2164,16 @@ public class TelephonyCallback { Binder.withCleanCallingIdentity( () -> mExecutor.execute(() -> listener.onCarrierRoamingNtnModeChanged(active))); } public void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) { if (!Flags.carrierRoamingNbIotNtn()) return; CarrierRoamingNtnModeListener listener = (CarrierRoamingNtnModeListener) mTelephonyCallbackWeakRef.get(); if (listener == null) return; Binder.withCleanCallingIdentity(() -> mExecutor.execute( () -> listener.onCarrierRoamingNtnEligibleStateChanged(eligible))); } } } core/java/android/telephony/TelephonyRegistryManager.java +33 −0 Original line number Diff line number Diff line Loading @@ -1090,6 +1090,34 @@ public class TelephonyRegistryManager { } } /** * Notify external listeners that device eligibility to connect to carrier roaming * non-terrestrial network changed. * * @param subId subscription ID. * @param eligible {@code true} when the device is eligible for satellite * communication if all the following conditions are met: * <ul> * <li>Any subscription supports P2P satellite messaging which is defined by * {@link CarrierConfigManager#KEY_SATELLITE_ATTACH_SUPPORTED_BOOL} </li> * <li>{@link CarrierConfigManager#KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT} set to * {@link CarrierConfigManager#CARRIER_ROAMING_NTN_CONNECT_MANUAL} </li> * <li>The device is in {@link ServiceState#STATE_OUT_OF_SERVICE}, not connected to Wi-Fi, * and the hysteresis timer defined by {@link CarrierConfigManager * #KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT} is expired. </li> * </ul> * * @hide */ public void notifyCarrierRoamingNtnEligibleStateChanged(int subId, boolean eligible) { try { sRegistry.notifyCarrierRoamingNtnEligibleStateChanged(subId, eligible); } catch (RemoteException ex) { // system server crash throw ex.rethrowFromSystemServer(); } } /** * Processes potential event changes from the provided {@link TelephonyCallback}. * Loading Loading @@ -1246,6 +1274,11 @@ public class TelephonyRegistryManager { if (telephonyCallback instanceof TelephonyCallback.CarrierRoamingNtnModeListener) { eventList.add(TelephonyCallback.EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED); } if (telephonyCallback instanceof TelephonyCallback.CarrierRoamingNtnModeListener) { eventList.add(TelephonyCallback.EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED); } return eventList; } Loading core/java/com/android/internal/telephony/IPhoneStateListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -82,4 +82,5 @@ oneway interface IPhoneStateListener { void onCallBackModeStopped(int type, int reason); void onSimultaneousCallingStateChanged(in int[] subIds); void onCarrierRoamingNtnModeChanged(in boolean active); void onCarrierRoamingNtnEligibleStateChanged(in boolean eligible); } core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -121,4 +121,5 @@ interface ITelephonyRegistry { void notifyCallbackModeStarted(int phoneId, int subId, int type); void notifyCallbackModeStopped(int phoneId, int subId, int type, int reason); void notifyCarrierRoamingNtnModeChanged(int subId, in boolean active); void notifyCarrierRoamingNtnEligibleStateChanged(int subId, in boolean eligible); } Loading
core/java/android/telephony/PhoneStateListener.java +4 −0 Original line number Diff line number Diff line Loading @@ -1689,6 +1689,10 @@ public class PhoneStateListener { public final void onCarrierRoamingNtnModeChanged(boolean active) { // not supported on the deprecated interface - Use TelephonyCallback instead } public final void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) { // not supported on the deprecated interface - Use TelephonyCallback instead } } private void log(String s) { Loading
core/java/android/telephony/TelephonyCallback.java +51 −1 Original line number Diff line number Diff line Loading @@ -652,6 +652,27 @@ public class TelephonyCallback { */ public static final int EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED = 42; /** * Event for listening to changes in carrier roaming non-terrestrial network eligibility. * * @see CarrierRoamingNtnModeListener * * Device is eligible for satellite communication if all the following conditions are met: * <ul> * <li>Any subscription on the device supports P2P satellite messaging which is defined by * {@link CarrierConfigManager#KEY_SATELLITE_ATTACH_SUPPORTED_BOOL} </li> * <li>{@link CarrierConfigManager#KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT} set to * {@link CarrierConfigManager#CARRIER_ROAMING_NTN_CONNECT_MANUAL} </li> * <li>The device is in {@link ServiceState#STATE_OUT_OF_SERVICE}, not connected to Wi-Fi, * and the hysteresis timer defined by {@link CarrierConfigManager * #KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT} is expired. * </li> * </ul> * * @hide */ public static final int EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED = 43; /** * @hide */ Loading Loading @@ -697,7 +718,8 @@ public class TelephonyCallback { EVENT_MEDIA_QUALITY_STATUS_CHANGED, EVENT_EMERGENCY_CALLBACK_MODE_CHANGED, EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED, EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED, EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED }) @Retention(RetentionPolicy.SOURCE) public @interface TelephonyEvent { Loading Loading @@ -1711,6 +1733,23 @@ public class TelephonyCallback { * {code false} otherwise. */ void onCarrierRoamingNtnModeChanged(boolean active); /** * Callback invoked when carrier roaming non-terrestrial network eligibility changes. * * @param eligible {@code true} when the device is eligible for satellite * communication if all the following conditions are met: * <ul> * <li>Any subscription on the device supports P2P satellite messaging which is defined by * {@link CarrierConfigManager#KEY_SATELLITE_ATTACH_SUPPORTED_BOOL} </li> * <li>{@link CarrierConfigManager#KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT} set to * {@link CarrierConfigManager#CARRIER_ROAMING_NTN_CONNECT_MANUAL} </li> * <li>The device is in {@link ServiceState#STATE_OUT_OF_SERVICE}, not connected to Wi-Fi, * and the hysteresis timer defined by {@link CarrierConfigManager * #KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT} is expired. </li> * </ul> */ default void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) {} } /** Loading Loading @@ -2125,5 +2164,16 @@ public class TelephonyCallback { Binder.withCleanCallingIdentity( () -> mExecutor.execute(() -> listener.onCarrierRoamingNtnModeChanged(active))); } public void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) { if (!Flags.carrierRoamingNbIotNtn()) return; CarrierRoamingNtnModeListener listener = (CarrierRoamingNtnModeListener) mTelephonyCallbackWeakRef.get(); if (listener == null) return; Binder.withCleanCallingIdentity(() -> mExecutor.execute( () -> listener.onCarrierRoamingNtnEligibleStateChanged(eligible))); } } }
core/java/android/telephony/TelephonyRegistryManager.java +33 −0 Original line number Diff line number Diff line Loading @@ -1090,6 +1090,34 @@ public class TelephonyRegistryManager { } } /** * Notify external listeners that device eligibility to connect to carrier roaming * non-terrestrial network changed. * * @param subId subscription ID. * @param eligible {@code true} when the device is eligible for satellite * communication if all the following conditions are met: * <ul> * <li>Any subscription supports P2P satellite messaging which is defined by * {@link CarrierConfigManager#KEY_SATELLITE_ATTACH_SUPPORTED_BOOL} </li> * <li>{@link CarrierConfigManager#KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT} set to * {@link CarrierConfigManager#CARRIER_ROAMING_NTN_CONNECT_MANUAL} </li> * <li>The device is in {@link ServiceState#STATE_OUT_OF_SERVICE}, not connected to Wi-Fi, * and the hysteresis timer defined by {@link CarrierConfigManager * #KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT} is expired. </li> * </ul> * * @hide */ public void notifyCarrierRoamingNtnEligibleStateChanged(int subId, boolean eligible) { try { sRegistry.notifyCarrierRoamingNtnEligibleStateChanged(subId, eligible); } catch (RemoteException ex) { // system server crash throw ex.rethrowFromSystemServer(); } } /** * Processes potential event changes from the provided {@link TelephonyCallback}. * Loading Loading @@ -1246,6 +1274,11 @@ public class TelephonyRegistryManager { if (telephonyCallback instanceof TelephonyCallback.CarrierRoamingNtnModeListener) { eventList.add(TelephonyCallback.EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED); } if (telephonyCallback instanceof TelephonyCallback.CarrierRoamingNtnModeListener) { eventList.add(TelephonyCallback.EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED); } return eventList; } Loading
core/java/com/android/internal/telephony/IPhoneStateListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -82,4 +82,5 @@ oneway interface IPhoneStateListener { void onCallBackModeStopped(int type, int reason); void onSimultaneousCallingStateChanged(in int[] subIds); void onCarrierRoamingNtnModeChanged(in boolean active); void onCarrierRoamingNtnEligibleStateChanged(in boolean eligible); }
core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -121,4 +121,5 @@ interface ITelephonyRegistry { void notifyCallbackModeStarted(int phoneId, int subId, int type); void notifyCallbackModeStopped(int phoneId, int subId, int type, int reason); void notifyCarrierRoamingNtnModeChanged(int subId, in boolean active); void notifyCarrierRoamingNtnEligibleStateChanged(int subId, in boolean eligible); }