Loading src/com/android/server/telecom/CallsManager.java +23 −6 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.PersistableBundle; import android.os.Process; import android.os.SystemClock; import android.os.SystemProperties; Loading Loading @@ -1100,9 +1101,11 @@ public class CallsManager extends Call.ListenerBase call.setIsVoipAudioMode(true); } } if (isRttSettingOn() || boolean isRttSettingOn = isRttSettingOn(phoneAccountHandle); if (isRttSettingOn || extras.getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false)) { Log.i(this, "Incoming call requesting RTT, rtt setting is %b", isRttSettingOn()); Log.i(this, "Incoming call requesting RTT, rtt setting is %b", isRttSettingOn); call.createRttStreams(); // Even if the phone account doesn't support RTT yet, the connection manager might // change that. Set this to check it later. Loading Loading @@ -1533,11 +1536,12 @@ public class CallsManager extends Call.ListenerBase boolean isVoicemail = isVoicemail(callToUse.getHandle(), accountToUse); if (!isVoicemail && (isRttSettingOn() || (extras != null boolean isRttSettingOn = isRttSettingOn(phoneAccountHandle); if (!isVoicemail && (isRttSettingOn || (extras != null && extras.getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false)))) { Log.d(this, "Outgoing call requesting RTT, rtt setting is %b", isRttSettingOn()); isRttSettingOn); if (callToUse.isEmergencyCall() || (accountToUse != null && accountToUse.hasCapabilities(PhoneAccount.CAPABILITY_RTT))) { // If the call requested RTT and it's an emergency call, ignore the Loading Loading @@ -2322,9 +2326,22 @@ public class CallsManager extends Call.ListenerBase mProximitySensorManager.turnOff(screenOnImmediately); } private boolean isRttSettingOn() { return Settings.Secure.getInt(mContext.getContentResolver(), private boolean isRttSettingOn(PhoneAccountHandle handle) { boolean isRttModeSettingOn = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.RTT_CALLING_MODE, 0) != 0; // If the carrier config says that we should ignore the RTT mode setting from the user, // assume that it's off (i.e. only make an RTT call if it's requested through the extra). boolean shouldIgnoreRttModeSetting = getCarrierConfigForPhoneAccount(handle) .getBoolean(CarrierConfigManager.KEY_IGNORE_RTT_MODE_SETTING_BOOL, false); return isRttModeSettingOn && !shouldIgnoreRttModeSetting; } private PersistableBundle getCarrierConfigForPhoneAccount(PhoneAccountHandle handle) { int subscriptionId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(handle); CarrierConfigManager carrierConfigManager = mContext.getSystemService(CarrierConfigManager.class); PersistableBundle result = carrierConfigManager.getConfigForSubId(subscriptionId); return result == null ? new PersistableBundle() : result; } void phoneAccountSelected(Call call, PhoneAccountHandle account, boolean setDefault) { Loading src/com/android/server/telecom/callfiltering/CallScreeningServiceController.java +1 −1 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ public class CallScreeningServiceController implements IncomingCallFilter.CallFi PersistableBundle configBundle = configManager.getConfig(); if (configBundle != null) { componentName = ComponentName.unflattenFromString(configBundle.getString (CarrierConfigManager.KEY_CARRIER_CALL_SCREENING_APP_STRING)); (CarrierConfigManager.KEY_CARRIER_CALL_SCREENING_APP_STRING, "")); } return componentName != null ? componentName.getPackageName() : null; Loading tests/src/com/android/server/telecom/tests/ComponentContextFixture.java +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.media.AudioManager; import android.os.Bundle; import android.os.Handler; import android.os.IInterface; import android.os.PersistableBundle; import android.os.UserHandle; import android.os.UserManager; import android.telecom.CallAudioState; Loading Loading @@ -209,6 +210,8 @@ public class ComponentContextFixture implements TestFixture<Context> { return Context.AUDIO_SERVICE; } else if (svcClass == TelephonyManager.class) { return Context.TELEPHONY_SERVICE; } else if (svcClass == CarrierConfigManager.class) { return Context.CARRIER_CONFIG_SERVICE; } throw new UnsupportedOperationException(); } Loading Loading @@ -513,6 +516,9 @@ public class ComponentContextFixture implements TestFixture<Context> { when(mNotificationManager.matchesCallFilter(any(Bundle.class))).thenReturn(true); when(mCarrierConfigManager.getConfig()).thenReturn(new PersistableBundle()); when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(new PersistableBundle()); when(mUserManager.getSerialNumberForUser(any(UserHandle.class))).thenReturn(-1L); doReturn(null).when(mApplicationContextSpy).registerReceiver(any(BroadcastReceiver.class), Loading Loading
src/com/android/server/telecom/CallsManager.java +23 −6 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.PersistableBundle; import android.os.Process; import android.os.SystemClock; import android.os.SystemProperties; Loading Loading @@ -1100,9 +1101,11 @@ public class CallsManager extends Call.ListenerBase call.setIsVoipAudioMode(true); } } if (isRttSettingOn() || boolean isRttSettingOn = isRttSettingOn(phoneAccountHandle); if (isRttSettingOn || extras.getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false)) { Log.i(this, "Incoming call requesting RTT, rtt setting is %b", isRttSettingOn()); Log.i(this, "Incoming call requesting RTT, rtt setting is %b", isRttSettingOn); call.createRttStreams(); // Even if the phone account doesn't support RTT yet, the connection manager might // change that. Set this to check it later. Loading Loading @@ -1533,11 +1536,12 @@ public class CallsManager extends Call.ListenerBase boolean isVoicemail = isVoicemail(callToUse.getHandle(), accountToUse); if (!isVoicemail && (isRttSettingOn() || (extras != null boolean isRttSettingOn = isRttSettingOn(phoneAccountHandle); if (!isVoicemail && (isRttSettingOn || (extras != null && extras.getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false)))) { Log.d(this, "Outgoing call requesting RTT, rtt setting is %b", isRttSettingOn()); isRttSettingOn); if (callToUse.isEmergencyCall() || (accountToUse != null && accountToUse.hasCapabilities(PhoneAccount.CAPABILITY_RTT))) { // If the call requested RTT and it's an emergency call, ignore the Loading Loading @@ -2322,9 +2326,22 @@ public class CallsManager extends Call.ListenerBase mProximitySensorManager.turnOff(screenOnImmediately); } private boolean isRttSettingOn() { return Settings.Secure.getInt(mContext.getContentResolver(), private boolean isRttSettingOn(PhoneAccountHandle handle) { boolean isRttModeSettingOn = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.RTT_CALLING_MODE, 0) != 0; // If the carrier config says that we should ignore the RTT mode setting from the user, // assume that it's off (i.e. only make an RTT call if it's requested through the extra). boolean shouldIgnoreRttModeSetting = getCarrierConfigForPhoneAccount(handle) .getBoolean(CarrierConfigManager.KEY_IGNORE_RTT_MODE_SETTING_BOOL, false); return isRttModeSettingOn && !shouldIgnoreRttModeSetting; } private PersistableBundle getCarrierConfigForPhoneAccount(PhoneAccountHandle handle) { int subscriptionId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(handle); CarrierConfigManager carrierConfigManager = mContext.getSystemService(CarrierConfigManager.class); PersistableBundle result = carrierConfigManager.getConfigForSubId(subscriptionId); return result == null ? new PersistableBundle() : result; } void phoneAccountSelected(Call call, PhoneAccountHandle account, boolean setDefault) { Loading
src/com/android/server/telecom/callfiltering/CallScreeningServiceController.java +1 −1 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ public class CallScreeningServiceController implements IncomingCallFilter.CallFi PersistableBundle configBundle = configManager.getConfig(); if (configBundle != null) { componentName = ComponentName.unflattenFromString(configBundle.getString (CarrierConfigManager.KEY_CARRIER_CALL_SCREENING_APP_STRING)); (CarrierConfigManager.KEY_CARRIER_CALL_SCREENING_APP_STRING, "")); } return componentName != null ? componentName.getPackageName() : null; Loading
tests/src/com/android/server/telecom/tests/ComponentContextFixture.java +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.media.AudioManager; import android.os.Bundle; import android.os.Handler; import android.os.IInterface; import android.os.PersistableBundle; import android.os.UserHandle; import android.os.UserManager; import android.telecom.CallAudioState; Loading Loading @@ -209,6 +210,8 @@ public class ComponentContextFixture implements TestFixture<Context> { return Context.AUDIO_SERVICE; } else if (svcClass == TelephonyManager.class) { return Context.TELEPHONY_SERVICE; } else if (svcClass == CarrierConfigManager.class) { return Context.CARRIER_CONFIG_SERVICE; } throw new UnsupportedOperationException(); } Loading Loading @@ -513,6 +516,9 @@ public class ComponentContextFixture implements TestFixture<Context> { when(mNotificationManager.matchesCallFilter(any(Bundle.class))).thenReturn(true); when(mCarrierConfigManager.getConfig()).thenReturn(new PersistableBundle()); when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(new PersistableBundle()); when(mUserManager.getSerialNumberForUser(any(UserHandle.class))).thenReturn(-1L); doReturn(null).when(mApplicationContextSpy).registerReceiver(any(BroadcastReceiver.class), Loading