Loading core/java/android/telephony/PhoneStateListener.java +4 −0 Original line number Diff line number Diff line Loading @@ -1685,6 +1685,10 @@ public class PhoneStateListener { public final void onSimultaneousCallingStateChanged(int[] subIds) { // not supported on the deprecated interface - Use TelephonyCallback instead } public final void onCarrierRoamingNtnModeChanged(boolean active) { // not supported on the deprecated interface - Use TelephonyCallback instead } } private void log(String s) { Loading core/java/android/telephony/TelephonyCallback.java +40 −1 Original line number Diff line number Diff line Loading @@ -643,6 +643,15 @@ public class TelephonyCallback { @SystemApi public static final int EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED = 41; /** * Event for listening to changes in carrier roaming non-terrestrial network mode. * * @see CarrierRoamingNtnModeListener * * @hide */ public static final int EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED = 42; /** * @hide */ Loading Loading @@ -687,7 +696,8 @@ public class TelephonyCallback { EVENT_TRIGGER_NOTIFY_ANBR, EVENT_MEDIA_QUALITY_STATUS_CHANGED, EVENT_EMERGENCY_CALLBACK_MODE_CHANGED, EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED, EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED }) @Retention(RetentionPolicy.SOURCE) public @interface TelephonyEvent { Loading Loading @@ -1685,6 +1695,24 @@ public class TelephonyCallback { @TelephonyManager.EmergencyCallbackModeStopReason int reason); } /** * Interface for carrier roaming non-terrestrial network listener. * * @hide */ public interface CarrierRoamingNtnModeListener { /** * Callback invoked when carrier roaming non-terrestrial network mode changes. * * @param active {@code true} If the device is connected to carrier roaming * non-terrestrial network or was connected within the * {CarrierConfigManager * #KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT} duration, * {code false} otherwise. */ void onCarrierRoamingNtnModeChanged(boolean active); } /** * The callback methods need to be called on the handler thread where * this object was created. If the binder did that for us it'd be nice. Loading Loading @@ -2086,5 +2114,16 @@ public class TelephonyCallback { Binder.withCleanCallingIdentity( () -> mExecutor.execute(() -> listener.onCallBackModeStopped(type, reason))); } public void onCarrierRoamingNtnModeChanged(boolean active) { if (!Flags.carrierEnabledSatelliteFlag()) return; CarrierRoamingNtnModeListener listener = (CarrierRoamingNtnModeListener) mTelephonyCallbackWeakRef.get(); if (listener == null) return; Binder.withCleanCallingIdentity( () -> mExecutor.execute(() -> listener.onCarrierRoamingNtnModeChanged(active))); } } } core/java/android/telephony/TelephonyRegistryManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -1072,6 +1072,24 @@ public class TelephonyRegistryManager { } } /** * Notify external listeners that carrier roaming non-terrestrial network mode changed. * @param subId subscription ID. * @param active {@code true} If the device is connected to carrier roaming * non-terrestrial network or was connected within the * {CarrierConfigManager#KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT} * duration, {code false} otherwise. * @hide */ public void notifyCarrierRoamingNtnModeChanged(int subId, boolean active) { try { sRegistry.notifyCarrierRoamingNtnModeChanged(subId, active); } catch (RemoteException ex) { // system server crash throw ex.rethrowFromSystemServer(); } } /** * Processes potential event changes from the provided {@link TelephonyCallback}. * Loading Loading @@ -1224,6 +1242,10 @@ public class TelephonyRegistryManager { eventList.add( TelephonyCallback.EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED); } if (telephonyCallback instanceof TelephonyCallback.CarrierRoamingNtnModeListener) { eventList.add(TelephonyCallback.EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED); } return eventList; } Loading core/java/com/android/internal/telephony/IPhoneStateListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -81,4 +81,5 @@ oneway interface IPhoneStateListener { void onCallBackModeStarted(int type); void onCallBackModeStopped(int type, int reason); void onSimultaneousCallingStateChanged(in int[] subIds); void onCarrierRoamingNtnModeChanged(in boolean active); } core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -120,4 +120,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); } Loading
core/java/android/telephony/PhoneStateListener.java +4 −0 Original line number Diff line number Diff line Loading @@ -1685,6 +1685,10 @@ public class PhoneStateListener { public final void onSimultaneousCallingStateChanged(int[] subIds) { // not supported on the deprecated interface - Use TelephonyCallback instead } public final void onCarrierRoamingNtnModeChanged(boolean active) { // not supported on the deprecated interface - Use TelephonyCallback instead } } private void log(String s) { Loading
core/java/android/telephony/TelephonyCallback.java +40 −1 Original line number Diff line number Diff line Loading @@ -643,6 +643,15 @@ public class TelephonyCallback { @SystemApi public static final int EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED = 41; /** * Event for listening to changes in carrier roaming non-terrestrial network mode. * * @see CarrierRoamingNtnModeListener * * @hide */ public static final int EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED = 42; /** * @hide */ Loading Loading @@ -687,7 +696,8 @@ public class TelephonyCallback { EVENT_TRIGGER_NOTIFY_ANBR, EVENT_MEDIA_QUALITY_STATUS_CHANGED, EVENT_EMERGENCY_CALLBACK_MODE_CHANGED, EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED, EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED }) @Retention(RetentionPolicy.SOURCE) public @interface TelephonyEvent { Loading Loading @@ -1685,6 +1695,24 @@ public class TelephonyCallback { @TelephonyManager.EmergencyCallbackModeStopReason int reason); } /** * Interface for carrier roaming non-terrestrial network listener. * * @hide */ public interface CarrierRoamingNtnModeListener { /** * Callback invoked when carrier roaming non-terrestrial network mode changes. * * @param active {@code true} If the device is connected to carrier roaming * non-terrestrial network or was connected within the * {CarrierConfigManager * #KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT} duration, * {code false} otherwise. */ void onCarrierRoamingNtnModeChanged(boolean active); } /** * The callback methods need to be called on the handler thread where * this object was created. If the binder did that for us it'd be nice. Loading Loading @@ -2086,5 +2114,16 @@ public class TelephonyCallback { Binder.withCleanCallingIdentity( () -> mExecutor.execute(() -> listener.onCallBackModeStopped(type, reason))); } public void onCarrierRoamingNtnModeChanged(boolean active) { if (!Flags.carrierEnabledSatelliteFlag()) return; CarrierRoamingNtnModeListener listener = (CarrierRoamingNtnModeListener) mTelephonyCallbackWeakRef.get(); if (listener == null) return; Binder.withCleanCallingIdentity( () -> mExecutor.execute(() -> listener.onCarrierRoamingNtnModeChanged(active))); } } }
core/java/android/telephony/TelephonyRegistryManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -1072,6 +1072,24 @@ public class TelephonyRegistryManager { } } /** * Notify external listeners that carrier roaming non-terrestrial network mode changed. * @param subId subscription ID. * @param active {@code true} If the device is connected to carrier roaming * non-terrestrial network or was connected within the * {CarrierConfigManager#KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT} * duration, {code false} otherwise. * @hide */ public void notifyCarrierRoamingNtnModeChanged(int subId, boolean active) { try { sRegistry.notifyCarrierRoamingNtnModeChanged(subId, active); } catch (RemoteException ex) { // system server crash throw ex.rethrowFromSystemServer(); } } /** * Processes potential event changes from the provided {@link TelephonyCallback}. * Loading Loading @@ -1224,6 +1242,10 @@ public class TelephonyRegistryManager { eventList.add( TelephonyCallback.EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED); } if (telephonyCallback instanceof TelephonyCallback.CarrierRoamingNtnModeListener) { eventList.add(TelephonyCallback.EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED); } return eventList; } Loading
core/java/com/android/internal/telephony/IPhoneStateListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -81,4 +81,5 @@ oneway interface IPhoneStateListener { void onCallBackModeStarted(int type); void onCallBackModeStopped(int type, int reason); void onSimultaneousCallingStateChanged(in int[] subIds); void onCarrierRoamingNtnModeChanged(in boolean active); }
core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -120,4 +120,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); }