From bcaff4d8a493c657519ae50cf7f3661da6c4a46b Mon Sep 17 00:00:00 2001 From: ironydelerium <42721860+ironydelerium@users.noreply.github.com> Date: Fri, 31 Dec 2021 02:20:28 -0800 Subject: [PATCH 2/5] Reintroduce 'public void TelephonyMetrics.writeRilSendSms(int, int, int, int)'. (#8) The MediaTek IMS package for Android Q, at the very least (likely for the rest, too) invoke this method in their `sendSms` method; Google, in their infinite wisdom, decided that this method needed a message ID passed in as well, changing the signature to 'public void TelephonyMetrics.writeRilSendSms(int, int, int, int, long)' and resulting in a MethodNotFoundException being raised in com.mediatek.ims, crashing it. Fixes https://github.com/phhusson/treble_experimentations/issues/2125. Co-authored-by: Sarah Vandomelen --- .../telephony/metrics/TelephonyMetrics.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java index 3fdbfe0ed7..fb8011c3df 100644 --- a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +++ b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java @@ -2320,6 +2320,19 @@ public class TelephonyMetrics { smsSession.increaseExpectedResponse(); } + /** + * Write Send SMS event (backwards-compatible method for R and earlier IMS implementations) + * + * @param phoneId Phone id + * @param rilSerial RIL request serial number + * @param tech SMS RAT + * @param format SMS format. Either {@link SmsMessage#FORMAT_3GPP} or + * {@link SmsMessage#FORMAT_3GPP2}. + */ + public void writeRilSendSms(int phoneId, int rilSerial, int tech, int format) { + writeRilSendSms(phoneId, rilSerial, tech, format, 0); + } + /** * Write Send SMS event using ImsService. Expecting response from * {@link #writeOnSmsSolicitedResponse}. -- 2.40.0