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

Commit 5b0e5bbf authored by Zongheng Wang's avatar Zongheng Wang
Browse files

Change createFromNativeSmsSubmitPdu for API review

* Change it into a public API
* Rename method to createSmsSubmitPdu
* Add maxTargetSdk to createFromEfRecord()’s UnsupportedAppUsage

Bug: 149697039
Test: compile
Change-Id: I067deb1063891e81bee96281d87a6319d6f72bf1
parent eabf5d70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45668,6 +45668,7 @@ package android.telephony {
    method public static int[] calculateLength(String, boolean);
    method @Deprecated public static android.telephony.SmsMessage createFromPdu(byte[]);
    method public static android.telephony.SmsMessage createFromPdu(byte[], String);
    method @Nullable public static android.telephony.SmsMessage createSmsSubmitPdu(@NonNull byte[], boolean);
    method public String getDisplayMessageBody();
    method public String getDisplayOriginatingAddress();
    method public String getEmailBody();
+0 −1
Original line number Diff line number Diff line
@@ -9229,7 +9229,6 @@ package android.telephony {
  }
  public class SmsMessage {
    method @Nullable public static android.telephony.SmsMessage createFromNativeSmsSubmitPdu(@NonNull byte[], boolean);
    method @Nullable public static android.telephony.SmsMessage.SubmitPdu getSmsPdu(int, int, @Nullable String, @NonNull String, @NonNull String, long);
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static byte[] getSubmitPduEncodedMessage(boolean, @NonNull String, @NonNull String, int, int, int, int, int, int);
  }
+1 −4
Original line number Diff line number Diff line
@@ -320,12 +320,9 @@ public class SmsMessage {
     * @param data Message data.
     * @param isCdma Indicates weather the type of the SMS is CDMA.
     * @return An SmsMessage representing the message.
     *
     * @hide
     */
    @SystemApi
    @Nullable
    public static SmsMessage createFromNativeSmsSubmitPdu(@NonNull byte[] data, boolean isCdma) {
    public static SmsMessage createSmsSubmitPdu(@NonNull byte[] data, boolean isCdma) {
        SmsMessageBase wrappedMessage;

        if (isCdma) {
+3 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.internal.telephony.cdma;

import android.compat.annotation.UnsupportedAppUsage;
import android.content.res.Resources;
import android.os.Build;
import android.sysprop.TelephonyProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.SmsCbLocation;
@@ -156,7 +157,8 @@ public class SmsMessage extends SmsMessageBase {
     *
     * @hide
     */
    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "Use {@link "
            + "android.telephony.SmsMessage} API instead")
    public static SmsMessage createFromEfRecord(int index, byte[] data) {
        try {
            SmsMessage msg = new SmsMessage();
+3 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static com.android.internal.telephony.SmsConstants.MessageClass;

import android.compat.annotation.UnsupportedAppUsage;
import android.content.res.Resources;
import android.os.Build;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;

@@ -179,7 +180,8 @@ public class SmsMessage extends SmsMessageBase {
     *
     * @hide
     */
    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "Use {@link "
            + "android.telephony.SmsMessage} API instead")
    public static SmsMessage createFromEfRecord(int index, byte[] data) {
        try {
            SmsMessage msg = new SmsMessage();