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

Commit 385cf172 authored by Michele Berionne's avatar Michele Berionne Committed by Automerger Merge Worker
Browse files

Merge "Fix synchronized usage for SMS metrics" am: 3fb15cf3

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

Change-Id: Id1fd9b79518340822fbe3ba6c824ca580b19ca9b
parents 210627eb 3fb15cf3
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) {