Loading res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,9 @@ <!-- System bluetooth stack package name --> <string name="system_bluetooth_stack">com.android.bluetooth</string> <!-- When true, skip fetching quick reply response --> <bool name="skip_loading_canned_text_response">false</bool> <!-- When true, skip fetching incoming caller info --> <bool name="skip_incoming_caller_info_query">false</bool> </resources> src/com/android/server/telecom/Call.java +5 −0 Original line number Diff line number Diff line Loading @@ -3730,6 +3730,11 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, * SMSes to that number will silently fail. */ public boolean isRespondViaSmsCapable() { if (mContext.getResources().getBoolean(R.bool.skip_loading_canned_text_response)) { Log.d(this, "maybeLoadCannedSmsResponses: skip loading due to setting"); return false; } if (mState != CallState.RINGING) { return false; } Loading tests/src/com/android/server/telecom/tests/CallTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ public class CallTest extends TelecomTestCase { .when(mMockConnectionService).getComponentName(); doReturn(UserHandle.CURRENT).when(mMockCallsManager).getCurrentUserHandle(); Resources mockResources = mContext.getResources(); when(mockResources.getBoolean(R.bool.skip_loading_canned_text_response)) .thenReturn(false); when(mockResources.getBoolean(R.bool.skip_incoming_caller_info_query)) .thenReturn(false); EmergencyCallHelper helper = mock(EmergencyCallHelper.class); Loading Loading @@ -964,6 +966,18 @@ public class CallTest extends TelecomTestCase { assertTrue(call.getExtras().containsKey(TelecomManager.EXTRA_DO_NOT_LOG_CALL)); } @Test @SmallTest public void testSkipLoadingCannedTextResponse() { Call call = createCall("any"); Resources mockResources = mContext.getResources(); when(mockResources.getBoolean(R.bool.skip_loading_canned_text_response)) .thenReturn(true); assertFalse(call.isRespondViaSmsCapable()); } private Call createCall(String id) { return createCall(id, Call.CALL_DIRECTION_UNDEFINED); } Loading Loading
res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,9 @@ <!-- System bluetooth stack package name --> <string name="system_bluetooth_stack">com.android.bluetooth</string> <!-- When true, skip fetching quick reply response --> <bool name="skip_loading_canned_text_response">false</bool> <!-- When true, skip fetching incoming caller info --> <bool name="skip_incoming_caller_info_query">false</bool> </resources>
src/com/android/server/telecom/Call.java +5 −0 Original line number Diff line number Diff line Loading @@ -3730,6 +3730,11 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, * SMSes to that number will silently fail. */ public boolean isRespondViaSmsCapable() { if (mContext.getResources().getBoolean(R.bool.skip_loading_canned_text_response)) { Log.d(this, "maybeLoadCannedSmsResponses: skip loading due to setting"); return false; } if (mState != CallState.RINGING) { return false; } Loading
tests/src/com/android/server/telecom/tests/CallTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ public class CallTest extends TelecomTestCase { .when(mMockConnectionService).getComponentName(); doReturn(UserHandle.CURRENT).when(mMockCallsManager).getCurrentUserHandle(); Resources mockResources = mContext.getResources(); when(mockResources.getBoolean(R.bool.skip_loading_canned_text_response)) .thenReturn(false); when(mockResources.getBoolean(R.bool.skip_incoming_caller_info_query)) .thenReturn(false); EmergencyCallHelper helper = mock(EmergencyCallHelper.class); Loading Loading @@ -964,6 +966,18 @@ public class CallTest extends TelecomTestCase { assertTrue(call.getExtras().containsKey(TelecomManager.EXTRA_DO_NOT_LOG_CALL)); } @Test @SmallTest public void testSkipLoadingCannedTextResponse() { Call call = createCall("any"); Resources mockResources = mContext.getResources(); when(mockResources.getBoolean(R.bool.skip_loading_canned_text_response)) .thenReturn(true); assertFalse(call.isRespondViaSmsCapable()); } private Call createCall(String id) { return createCall(id, Call.CALL_DIRECTION_UNDEFINED); } Loading