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

Commit 3fb15cf3 authored by Michele Berionne's avatar Michele Berionne Committed by Gerrit Code Review
Browse files

Merge "Fix synchronized usage for SMS metrics"

parents de08d9d4 3297bcba
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -274,7 +274,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])) {
@@ -1135,7 +1135,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);
@@ -1817,12 +1817,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) {