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

Commit 2d8625de authored by Jack Yu's avatar Jack Yu Committed by Gerrit Code Review
Browse files

Merge "Client side logging for SMS metrics."

parents 19ffee6d 270454b4
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
@@ -1199,6 +1199,9 @@ message SmsSession {

      // Notification about received SMS
      SMS_RECEIVED = 8;

      // CB message received
      CB_SMS_RECEIVED = 9;
    }

    // Formats used to encode SMS messages
@@ -1224,6 +1227,51 @@ message SmsSession {
      SMS_IMS = 3;
    }

    message CBMessage {
      // CB message format
      optional Format msgFormat = 1;

      // CB message priority
      optional CBPriority msgPriority = 2;

      // Type of CB msg
      optional CBMessageType msgType = 3;

      // Service category of CB message
      optional int32 serviceCategory = 4;
    }

    enum CBMessageType {
      // Unknown type
      TYPE_UNKNOWN = 0;

      // ETWS CB msg
      ETWS = 1;

      // CMAS CB msg
      CMAS = 2;

      // CB msg other than ETWS and CMAS
      OTHER = 3;
    }

    enum CBPriority {
      // Unknown priority
      PRIORITY_UNKNOWN = 0;

      // NORMAL priority
      NORMAL = 1;

      // Interactive priority
      INTERACTIVE = 2;

      // Urgent priority
      URGENT = 3;

      // Emergency priority
      EMERGENCY = 4;
    }

    // Event type
    optional Type type = 1;

@@ -1261,6 +1309,9 @@ message SmsSession {

    // Numeric ID
    optional int32 ril_request_id = 12;

    // Cellbroadcast message content
    optional CBMessage cell_broadcast_message = 13;
  }

  // Time when session has started, in minutes since epoch,
+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import android.provider.Telephony;
import android.telephony.SmsCbMessage;
import android.telephony.SubscriptionManager;

import com.android.internal.telephony.metrics.TelephonyMetrics;

/**
 * Dispatch new Cell Broadcasts to receivers. Acquires a private wakelock until the broadcast
 * completes and our result receiver is called.
@@ -82,6 +84,12 @@ public class CellBroadcastHandler extends WakeLockStateMachine {
        String receiverPermission;
        int appOp;

        // Log Cellbroadcast msg received event
        TelephonyMetrics metrics = TelephonyMetrics.getInstance();
        metrics.writeNewCBSms(mPhone.getPhoneId(), message.getMessageFormat(),
                message.getMessagePriority(), message.isCmasMessage(), message.isEtwsMessage(),
                message.getServiceCategory());

        Intent intent;
        if (message.isEmergencyMessage()) {
            log("Dispatching emergency SMS CB, SmsCbMessage is: " + message);
+1 −1
Original line number Diff line number Diff line
@@ -3098,7 +3098,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
            try {
                radioProxy.sendImsSms(rr.mSerial, msg);
                mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_IMS,
                        SmsSession.Event.Format.SMS_FORMAT_3GPP);
                        SmsSession.Event.Format.SMS_FORMAT_3GPP2);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "sendImsCdmaSms", e);
            }
+0 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Message;
import android.os.SystemProperties;
import android.provider.Telephony.Sms.Intents;
import android.telephony.SmsCbMessage;

@@ -33,7 +32,6 @@ import com.android.internal.telephony.SmsConstants;
import com.android.internal.telephony.SmsMessageBase;
import com.android.internal.telephony.SmsStorageMonitor;
import com.android.internal.telephony.TelephonyComponentFactory;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.WspTypeDecoder;
import com.android.internal.telephony.cdma.sms.SmsEnvelope;
import com.android.internal.util.HexDump;
+5 −0
Original line number Diff line number Diff line
@@ -88,4 +88,9 @@ public class SmsSessionEventBuilder {
        mEvent.format = format;
        return this;
    }

    public SmsSessionEventBuilder setCellBroadcastMessage(SmsSession.Event.CBMessage msg) {
        mEvent.cellBroadcastMessage = msg;
        return this;
    }
}
Loading