Loading src/com/android/server/telecom/TelecomServiceImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -449,8 +449,8 @@ public class TelecomServiceImpl { try { Log.startSession("TSI.rPA"); synchronized (mLock) { if (!mContext.getApplicationContext().getResources().getBoolean( com.android.internal.R.bool.config_voice_capable)) { if (!((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable()) { Log.w(this, "registerPhoneAccount not allowed on non-voice capable device."); return; Loading src/com/android/server/telecom/components/UserCallIntentProcessor.java +3 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.telecom.PhoneAccount; import android.telecom.TelecomManager; import android.telecom.VideoProfile; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; import com.android.server.telecom.CallIntentProcessor; import com.android.server.telecom.R; Loading Loading @@ -163,8 +164,8 @@ public class UserCallIntentProcessor { * @return {@code True} if the device is voice-capable. */ private boolean isVoiceCapable() { return mContext.getApplicationContext().getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); return ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable(); } /** Loading tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,10 @@ public class TelecomServiceImplTest extends TelecomTestCase { public void setUp() throws Exception { super.setUp(); mContext = mComponentContextFixture.getTestDouble().getApplicationContext(); mComponentContextFixture.putBooleanResource( com.android.internal.R.bool.config_voice_capable, true); TelephonyManager mockTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); when(mockTelephonyManager.isVoiceCapable()).thenReturn(true); doReturn(mContext).when(mContext).getApplicationContext(); doNothing().when(mContext).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), Loading tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -581,8 +581,9 @@ public class TelecomSystemTest extends TelecomTestCase { mComponentContextFixture.putResource( com.android.server.telecom.R.string.incall_default_class, mInCallServiceComponentNameX.getClassName()); mComponentContextFixture.putBooleanResource( com.android.internal.R.bool.config_voice_capable, true); doReturn(true).when(mComponentContextFixture.getTelephonyManager()) .isVoiceCapable(); mInCallServiceFixtureX = new InCallServiceFixture(); mInCallServiceFixtureY = new InCallServiceFixture(); Loading Loading
src/com/android/server/telecom/TelecomServiceImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -449,8 +449,8 @@ public class TelecomServiceImpl { try { Log.startSession("TSI.rPA"); synchronized (mLock) { if (!mContext.getApplicationContext().getResources().getBoolean( com.android.internal.R.bool.config_voice_capable)) { if (!((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable()) { Log.w(this, "registerPhoneAccount not allowed on non-voice capable device."); return; Loading
src/com/android/server/telecom/components/UserCallIntentProcessor.java +3 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.telecom.PhoneAccount; import android.telecom.TelecomManager; import android.telecom.VideoProfile; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; import com.android.server.telecom.CallIntentProcessor; import com.android.server.telecom.R; Loading Loading @@ -163,8 +164,8 @@ public class UserCallIntentProcessor { * @return {@code True} if the device is voice-capable. */ private boolean isVoiceCapable() { return mContext.getApplicationContext().getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); return ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable(); } /** Loading
tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,10 @@ public class TelecomServiceImplTest extends TelecomTestCase { public void setUp() throws Exception { super.setUp(); mContext = mComponentContextFixture.getTestDouble().getApplicationContext(); mComponentContextFixture.putBooleanResource( com.android.internal.R.bool.config_voice_capable, true); TelephonyManager mockTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); when(mockTelephonyManager.isVoiceCapable()).thenReturn(true); doReturn(mContext).when(mContext).getApplicationContext(); doNothing().when(mContext).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), Loading
tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -581,8 +581,9 @@ public class TelecomSystemTest extends TelecomTestCase { mComponentContextFixture.putResource( com.android.server.telecom.R.string.incall_default_class, mInCallServiceComponentNameX.getClassName()); mComponentContextFixture.putBooleanResource( com.android.internal.R.bool.config_voice_capable, true); doReturn(true).when(mComponentContextFixture.getTelephonyManager()) .isVoiceCapable(); mInCallServiceFixtureX = new InCallServiceFixture(); mInCallServiceFixtureY = new InCallServiceFixture(); Loading