Loading flags/calling.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -62,3 +62,11 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=yongnamcha TARGET=25Q2 flag { name: "emergency_callback_mode_notification" namespace: "telephony" description: "Used to notify the emergency callback mode for call/SMS to other applications." bug:"359064059" } src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +17 −3 Original line number Diff line number Diff line Loading @@ -303,14 +303,28 @@ public class DefaultPhoneNotifier implements PhoneNotifier { } @Override public void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type) { mTelephonyRegistryMgr.notifyCallBackModeStarted(sender.getPhoneId(), sender.getSubId(), type); public void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; mTelephonyRegistryMgr.notifyCallbackModeStarted(sender.getPhoneId(), sender.getSubId(), type, durationMillis); } @Override public void notifyCallbackModeRestarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; mTelephonyRegistryMgr.notifyCallbackModeRestarted(sender.getPhoneId(), sender.getSubId(), type, durationMillis); } @Override public void notifyCallbackModeStopped(Phone sender, @EmergencyCallbackModeType int type, @EmergencyCallbackModeStopReason int reason) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; mTelephonyRegistryMgr.notifyCallbackModeStopped(sender.getPhoneId(), sender.getSubId(), type, reason); } Loading src/java/com/android/internal/telephony/Phone.java +28 −7 Original line number Diff line number Diff line Loading @@ -5295,22 +5295,43 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { } /** * Start callback mode * Start the emergency callback mode * @param type for callback mode entry. * @param durationMillis is the number of milliseconds remaining in the emergency callback * mode. */ public void startCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type) { Rlog.d(mLogTag, "startCallbackMode:type=" + type); mNotifier.notifyCallbackModeStarted(this, type); public void startEmergencyCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; Rlog.d(mLogTag, "startEmergencyCallbackMode:type=" + type); mNotifier.notifyCallbackModeStarted(this, type, durationMillis); } /** * Restart the emergency callback mode * @param type for callback mode entry. * @param durationMillis is the number of milliseconds remaining in the emergency callback * mode. */ public void restartEmergencyCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; Rlog.d(mLogTag, "restartEmergencyCallbackMode:type=" + type); mNotifier.notifyCallbackModeRestarted(this, type, durationMillis); } /** * Stop callback mode * Stop the emergency callback mode * @param type for callback mode exit. * @param reason for stopping callback mode. */ public void stopCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, public void stopEmergencyCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, @TelephonyManager.EmergencyCallbackModeStopReason int reason) { Rlog.d(mLogTag, "stopCallbackMode:type=" + type + ", reason=" + reason); if (!mFeatureFlags.emergencyCallbackModeNotification()) return; Rlog.d(mLogTag, "stopEmergencyCallbackMode:type=" + type + ", reason=" + reason); mNotifier.notifyCallbackModeStopped(this, type, reason); } Loading src/java/com/android/internal/telephony/PhoneNotifier.java +6 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,12 @@ public interface PhoneNotifier { List<LinkCapacityEstimate> linkCapacityEstimateList); /** Notify callback mode started. */ void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type); void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis); /** Notify callback mode restarted. */ void notifyCallbackModeRestarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis); /** Notify callback mode stopped. */ void notifyCallbackModeStopped(Phone sender, @EmergencyCallbackModeType int type, Loading tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java +45 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,51 @@ public class DefaultPhoneNotifierTest extends TelephonyTest { eq(subs)); } @Test @SmallTest public void testNotifyCallbackModeStarted() { doReturn(true).when(mFeatureFlags).emergencyCallbackModeNotification(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); int type = 1; long durationMillis = 1000; mDefaultPhoneNotifierUT.notifyCallbackModeStarted(mPhone, type, durationMillis); verify(mTelephonyRegistryManager).notifyCallbackModeStarted(eq(phoneId), eq(subId), eq(type), eq(durationMillis)); } @Test @SmallTest public void testNotifyCallbackModeRestarted() { doReturn(true).when(mFeatureFlags).emergencyCallbackModeNotification(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); int type = 1; long durationMillis = 1000; mDefaultPhoneNotifierUT.notifyCallbackModeRestarted(mPhone, type, durationMillis); verify(mTelephonyRegistryManager).notifyCallbackModeRestarted(eq(phoneId), eq(subId), eq(type), eq(durationMillis)); } @Test @SmallTest public void testNotifyCallbackModeStopped() { doReturn(true).when(mFeatureFlags).emergencyCallbackModeNotification(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); int type = 1; int reason = 0; mDefaultPhoneNotifierUT.notifyCallbackModeStopped(mPhone, type, reason); verify(mTelephonyRegistryManager).notifyCallbackModeStopped(eq(phoneId), eq(subId), eq(type), eq(reason)); } @Test @SmallTest public void testCarrierRoamingNtnModeChanged() { Loading Loading
flags/calling.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -62,3 +62,11 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=yongnamcha TARGET=25Q2 flag { name: "emergency_callback_mode_notification" namespace: "telephony" description: "Used to notify the emergency callback mode for call/SMS to other applications." bug:"359064059" }
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +17 −3 Original line number Diff line number Diff line Loading @@ -303,14 +303,28 @@ public class DefaultPhoneNotifier implements PhoneNotifier { } @Override public void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type) { mTelephonyRegistryMgr.notifyCallBackModeStarted(sender.getPhoneId(), sender.getSubId(), type); public void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; mTelephonyRegistryMgr.notifyCallbackModeStarted(sender.getPhoneId(), sender.getSubId(), type, durationMillis); } @Override public void notifyCallbackModeRestarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; mTelephonyRegistryMgr.notifyCallbackModeRestarted(sender.getPhoneId(), sender.getSubId(), type, durationMillis); } @Override public void notifyCallbackModeStopped(Phone sender, @EmergencyCallbackModeType int type, @EmergencyCallbackModeStopReason int reason) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; mTelephonyRegistryMgr.notifyCallbackModeStopped(sender.getPhoneId(), sender.getSubId(), type, reason); } Loading
src/java/com/android/internal/telephony/Phone.java +28 −7 Original line number Diff line number Diff line Loading @@ -5295,22 +5295,43 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { } /** * Start callback mode * Start the emergency callback mode * @param type for callback mode entry. * @param durationMillis is the number of milliseconds remaining in the emergency callback * mode. */ public void startCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type) { Rlog.d(mLogTag, "startCallbackMode:type=" + type); mNotifier.notifyCallbackModeStarted(this, type); public void startEmergencyCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; Rlog.d(mLogTag, "startEmergencyCallbackMode:type=" + type); mNotifier.notifyCallbackModeStarted(this, type, durationMillis); } /** * Restart the emergency callback mode * @param type for callback mode entry. * @param durationMillis is the number of milliseconds remaining in the emergency callback * mode. */ public void restartEmergencyCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, long durationMillis) { if (!mFeatureFlags.emergencyCallbackModeNotification()) return; Rlog.d(mLogTag, "restartEmergencyCallbackMode:type=" + type); mNotifier.notifyCallbackModeRestarted(this, type, durationMillis); } /** * Stop callback mode * Stop the emergency callback mode * @param type for callback mode exit. * @param reason for stopping callback mode. */ public void stopCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, public void stopEmergencyCallbackMode(@TelephonyManager.EmergencyCallbackModeType int type, @TelephonyManager.EmergencyCallbackModeStopReason int reason) { Rlog.d(mLogTag, "stopCallbackMode:type=" + type + ", reason=" + reason); if (!mFeatureFlags.emergencyCallbackModeNotification()) return; Rlog.d(mLogTag, "stopEmergencyCallbackMode:type=" + type + ", reason=" + reason); mNotifier.notifyCallbackModeStopped(this, type, reason); } Loading
src/java/com/android/internal/telephony/PhoneNotifier.java +6 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,12 @@ public interface PhoneNotifier { List<LinkCapacityEstimate> linkCapacityEstimateList); /** Notify callback mode started. */ void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type); void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis); /** Notify callback mode restarted. */ void notifyCallbackModeRestarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis); /** Notify callback mode stopped. */ void notifyCallbackModeStopped(Phone sender, @EmergencyCallbackModeType int type, Loading
tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java +45 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,51 @@ public class DefaultPhoneNotifierTest extends TelephonyTest { eq(subs)); } @Test @SmallTest public void testNotifyCallbackModeStarted() { doReturn(true).when(mFeatureFlags).emergencyCallbackModeNotification(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); int type = 1; long durationMillis = 1000; mDefaultPhoneNotifierUT.notifyCallbackModeStarted(mPhone, type, durationMillis); verify(mTelephonyRegistryManager).notifyCallbackModeStarted(eq(phoneId), eq(subId), eq(type), eq(durationMillis)); } @Test @SmallTest public void testNotifyCallbackModeRestarted() { doReturn(true).when(mFeatureFlags).emergencyCallbackModeNotification(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); int type = 1; long durationMillis = 1000; mDefaultPhoneNotifierUT.notifyCallbackModeRestarted(mPhone, type, durationMillis); verify(mTelephonyRegistryManager).notifyCallbackModeRestarted(eq(phoneId), eq(subId), eq(type), eq(durationMillis)); } @Test @SmallTest public void testNotifyCallbackModeStopped() { doReturn(true).when(mFeatureFlags).emergencyCallbackModeNotification(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); int type = 1; int reason = 0; mDefaultPhoneNotifierUT.notifyCallbackModeStopped(mPhone, type, reason); verify(mTelephonyRegistryManager).notifyCallbackModeStopped(eq(phoneId), eq(subId), eq(type), eq(reason)); } @Test @SmallTest public void testCarrierRoamingNtnModeChanged() { Loading