Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c4835be authored by Michele Berionne's avatar Michele Berionne Committed by Automerger Merge Worker
Browse files

Merge "Fix synchronized usage for SMS metrics" am: 3fb15cf3 am: 385cf172 am: 9459fdb3

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1640502

Change-Id: I938c0d6f2f641d7dbc60efa34382a02022ba0782
parents 724e9aea 9459fdb3
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ public class TelephonyMetrics {
     * @param pw Print writer
     * @param args Arguments
     */
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    public synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (args != null && args.length > 0) {
            boolean reset = true;
            if (args.length > 1 && "--keep".equals(args[1])) {
@@ -1136,7 +1136,7 @@ public class TelephonyMetrics {
        }
    }

    private SmsSession finishSmsSession(InProgressSmsSession inProgressSmsSession) {
    private synchronized SmsSession finishSmsSession(InProgressSmsSession inProgressSmsSession) {
        SmsSession smsSession = new SmsSession();
        smsSession.events = new SmsSession.Event[inProgressSmsSession.events.size()];
        inProgressSmsSession.events.toArray(smsSession.events);
@@ -1818,12 +1818,10 @@ public class TelephonyMetrics {
     */
    private synchronized void writeOnSmsSolicitedResponse(int phoneId, int rilSerial, int rilError,
                                                          SmsResponse response) {

        InProgressSmsSession smsSession = mInProgressSmsSessions.get(phoneId);
        if (smsSession == null) {
            Rlog.e(TAG, "SMS session is missing");
        } else {

            int errorCode = SmsResponse.NO_ERROR_CODE;
            long messageId = 0L;
            if (response != null) {