Loading src/com/android/server/telecom/PhoneAccountRegistrar.java +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ public final class PhoneAccountRegistrar { !TextUtils.isDigitsOnly(accountHandle.getId())) { // Since no decimals or negative numbers can be valid subscription ids, only a string of // numbers can be subscription id return -1; return SubscriptionManager.INVALID_SUB_ID; } return Integer.parseInt(accountHandle.getId()); } Loading src/com/android/server/telecom/RespondViaSmsManager.java +12 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.telecom; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.os.SomeArgs; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.SmsApplication; import android.content.ComponentName; Loading @@ -29,6 +30,7 @@ import android.net.Uri; import android.os.Handler; import android.os.Message; import android.telecom.Response; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.widget.Toast; Loading Loading @@ -140,8 +142,12 @@ public class RespondViaSmsManager extends CallsManagerListenerBase { @Override public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) { if (rejectWithMessage && call.getHandle() != null) { PhoneAccountRegistrar phoneAccountRegistrar = CallsManager.getInstance().getPhoneAccountRegistrar(); int subId = phoneAccountRegistrar.getSubscriptionIdForPhoneAccount( call.getTargetPhoneAccount()); rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(), textMessage); textMessage, subId); } } Loading Loading @@ -174,7 +180,8 @@ public class RespondViaSmsManager extends CallsManagerListenerBase { /** * Reject the call with the specified message. If message is null this call is ignored. */ private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage) { private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage, int subId) { if (textMessage != null) { final ComponentName component = SmsApplication.getDefaultRespondViaMessageApplication(context, Loading @@ -184,6 +191,9 @@ public class RespondViaSmsManager extends CallsManagerListenerBase { final Uri uri = Uri.fromParts(Constants.SCHEME_SMSTO, phoneNumber, null); final Intent intent = new Intent(TelephonyManager.ACTION_RESPOND_VIA_MESSAGE, uri); intent.putExtra(Intent.EXTRA_TEXT, textMessage); if (subId != SubscriptionManager.INVALID_SUB_ID) { intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); } SomeArgs args = SomeArgs.obtain(); args.arg1 = phoneNumber; Loading Loading
src/com/android/server/telecom/PhoneAccountRegistrar.java +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ public final class PhoneAccountRegistrar { !TextUtils.isDigitsOnly(accountHandle.getId())) { // Since no decimals or negative numbers can be valid subscription ids, only a string of // numbers can be subscription id return -1; return SubscriptionManager.INVALID_SUB_ID; } return Integer.parseInt(accountHandle.getId()); } Loading
src/com/android/server/telecom/RespondViaSmsManager.java +12 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.telecom; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.os.SomeArgs; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.SmsApplication; import android.content.ComponentName; Loading @@ -29,6 +30,7 @@ import android.net.Uri; import android.os.Handler; import android.os.Message; import android.telecom.Response; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.widget.Toast; Loading Loading @@ -140,8 +142,12 @@ public class RespondViaSmsManager extends CallsManagerListenerBase { @Override public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) { if (rejectWithMessage && call.getHandle() != null) { PhoneAccountRegistrar phoneAccountRegistrar = CallsManager.getInstance().getPhoneAccountRegistrar(); int subId = phoneAccountRegistrar.getSubscriptionIdForPhoneAccount( call.getTargetPhoneAccount()); rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(), textMessage); textMessage, subId); } } Loading Loading @@ -174,7 +180,8 @@ public class RespondViaSmsManager extends CallsManagerListenerBase { /** * Reject the call with the specified message. If message is null this call is ignored. */ private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage) { private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage, int subId) { if (textMessage != null) { final ComponentName component = SmsApplication.getDefaultRespondViaMessageApplication(context, Loading @@ -184,6 +191,9 @@ public class RespondViaSmsManager extends CallsManagerListenerBase { final Uri uri = Uri.fromParts(Constants.SCHEME_SMSTO, phoneNumber, null); final Intent intent = new Intent(TelephonyManager.ACTION_RESPOND_VIA_MESSAGE, uri); intent.putExtra(Intent.EXTRA_TEXT, textMessage); if (subId != SubscriptionManager.INVALID_SUB_ID) { intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); } SomeArgs args = SomeArgs.obtain(); args.arg1 = phoneNumber; Loading