[RCS]Migrate from getEncodedMessage() to toEncodedMessage()

Bug: 184018068
Test: build pass
Change-Id: I14c0d2c8ce55599abcad06e2d0d2e630b02ab3b0
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index c18a9e3..bb09e88 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -11997,7 +11997,6 @@
     method public int describeContents();
     method @Nullable public String getCallIdParameter();
     method @NonNull public byte[] getContent();
-    method @Deprecated @NonNull public byte[] getEncodedMessage();
     method @NonNull public String getHeaderSection();
     method @NonNull public String getStartLine();
     method @NonNull public String getViaBranchParameter();
diff --git a/telephony/java/android/telephony/ims/SipMessage.java b/telephony/java/android/telephony/ims/SipMessage.java
index d21fcab..391372a 100644
--- a/telephony/java/android/telephony/ims/SipMessage.java
+++ b/telephony/java/android/telephony/ims/SipMessage.java
@@ -203,23 +203,6 @@
     }
 
     /**
-     * @return the UTF-8 encoded SIP message.
-     * @deprecated Use {@link #toEncodedMessage} instead
-     */
-    @Deprecated
-    public @NonNull byte[] getEncodedMessage() {
-        byte[] header = new StringBuilder()
-                .append(mStartLine)
-                .append(mHeaderSection)
-                .append(CRLF)
-                .toString().getBytes(UTF_8);
-        byte[] sipMessage = new byte[header.length + mContent.length];
-        System.arraycopy(header, 0, sipMessage, 0, header.length);
-        System.arraycopy(mContent, 0, sipMessage, header.length, mContent.length);
-        return sipMessage;
-    }
-
-    /**
      * According RFC-3261 section 7, SIP is a text protocol and uses the UTF-8 charset. Its format
      * consists of a start-line, one or more header fields, an empty line indicating the end of the
      * header fields, and an optional message-body.