Merge "Add @UnsupportedAppUsage annotations"
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index 6552c9c..6f06edc 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -2172,47 +2172,7 @@
 Lcom/android/internal/statusbar/IStatusBarService;->setIconVisibility(Ljava/lang/String;Z)V
 Lcom/android/internal/telecom/ITelecomService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telecom/ITelecomService;
 Lcom/android/internal/telecom/ITelecomService;->getCallState()I
-Lcom/android/internal/telephony/CallerInfo;-><init>()V
-Lcom/android/internal/telephony/CallerInfo;->contactIdOrZero:J
-Lcom/android/internal/telephony/CallerInfo;->getCallerInfo(Landroid/content/Context;Landroid/net/Uri;)Lcom/android/internal/telephony/CallerInfo;
-Lcom/android/internal/telephony/CallerInfo;->getCallerInfo(Landroid/content/Context;Ljava/lang/String;)Lcom/android/internal/telephony/CallerInfo;
-Lcom/android/internal/telephony/CallerInfo;->getCallerInfo(Landroid/content/Context;Ljava/lang/String;I)Lcom/android/internal/telephony/CallerInfo;
-Lcom/android/internal/telephony/CallerInfo;->name:Ljava/lang/String;
-Lcom/android/internal/telephony/CallerInfo;->numberLabel:Ljava/lang/String;
-Lcom/android/internal/telephony/CallerInfo;->numberType:I
-Lcom/android/internal/telephony/CallerInfo;->phoneNumber:Ljava/lang/String;
-Lcom/android/internal/telephony/EncodeException;-><init>(C)V
-Lcom/android/internal/telephony/EncodeException;-><init>(Ljava/lang/String;)V
-Lcom/android/internal/telephony/GsmAlphabet$LanguagePairCount;-><init>(I)V
-Lcom/android/internal/telephony/GsmAlphabet$LanguagePairCount;->languageCode:I
-Lcom/android/internal/telephony/GsmAlphabet$LanguagePairCount;->septetCounts:[I
-Lcom/android/internal/telephony/GsmAlphabet$LanguagePairCount;->unencodableCounts:[I
 Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;-><init>()V
-Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;->codeUnitCount:I
-Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;->codeUnitSize:I
-Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;->codeUnitsRemaining:I
-Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;->languageShiftTable:I
-Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;->languageTable:I
-Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;->msgCount:I
-Lcom/android/internal/telephony/GsmAlphabet;->charToGsm(C)I
-Lcom/android/internal/telephony/GsmAlphabet;->charToGsm(CZ)I
-Lcom/android/internal/telephony/GsmAlphabet;->countGsmSeptets(CZ)I
-Lcom/android/internal/telephony/GsmAlphabet;->findGsmSeptetLimitIndex(Ljava/lang/String;IIII)I
-Lcom/android/internal/telephony/GsmAlphabet;->gsm7BitPackedToString([BIIIII)Ljava/lang/String;
-Lcom/android/internal/telephony/GsmAlphabet;->gsm8BitUnpackedToString([BII)Ljava/lang/String;
-Lcom/android/internal/telephony/GsmAlphabet;->gsm8BitUnpackedToString([BIILjava/lang/String;)Ljava/lang/String;
-Lcom/android/internal/telephony/GsmAlphabet;->gsmToChar(I)C
-Lcom/android/internal/telephony/GsmAlphabet;->packSmsChar([BII)V
-Lcom/android/internal/telephony/GsmAlphabet;->sCharsToGsmTables:[Landroid/util/SparseIntArray;
-Lcom/android/internal/telephony/GsmAlphabet;->sCharsToShiftTables:[Landroid/util/SparseIntArray;
-Lcom/android/internal/telephony/GsmAlphabet;->sEnabledLockingShiftTables:[I
-Lcom/android/internal/telephony/GsmAlphabet;->sEnabledSingleShiftTables:[I
-Lcom/android/internal/telephony/GsmAlphabet;->sHighestEnabledSingleShiftCode:I
-Lcom/android/internal/telephony/GsmAlphabet;->sLanguageShiftTables:[Ljava/lang/String;
-Lcom/android/internal/telephony/GsmAlphabet;->sLanguageTables:[Ljava/lang/String;
-Lcom/android/internal/telephony/GsmAlphabet;->stringToGsm7BitPacked(Ljava/lang/String;IZII)[B
-Lcom/android/internal/telephony/GsmAlphabet;->stringToGsm7BitPackedWithHeader(Ljava/lang/String;[BII)[B
-Lcom/android/internal/telephony/GsmAlphabet;->stringToGsm8BitPacked(Ljava/lang/String;)[B
 Lcom/android/internal/telephony/ICarrierConfigLoader;->getConfigForSubId(ILjava/lang/String;)Landroid/os/PersistableBundle;
 Lcom/android/internal/telephony/IMms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IMms;
 Lcom/android/internal/telephony/IPhoneStateListener$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IPhoneStateListener;
@@ -2287,62 +2247,9 @@
 Lcom/android/internal/telephony/IWapPushManager;->addPackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)Z
 Lcom/android/internal/telephony/IWapPushManager;->deletePackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
 Lcom/android/internal/telephony/IWapPushManager;->updatePackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)Z
-Lcom/android/internal/telephony/OperatorInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
-Lcom/android/internal/telephony/OperatorInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/android/internal/telephony/OperatorInfo$State;)V
-Lcom/android/internal/telephony/OperatorInfo;->mOperatorAlphaLong:Ljava/lang/String;
-Lcom/android/internal/telephony/OperatorInfo;->mOperatorAlphaShort:Ljava/lang/String;
-Lcom/android/internal/telephony/OperatorInfo;->mOperatorNumeric:Ljava/lang/String;
-Lcom/android/internal/telephony/OperatorInfo;->mState:Lcom/android/internal/telephony/OperatorInfo$State;
-Lcom/android/internal/telephony/OperatorInfo;->rilStateToState(Ljava/lang/String;)Lcom/android/internal/telephony/OperatorInfo$State;
-Lcom/android/internal/telephony/SmsAddress;->origBytes:[B
-Lcom/android/internal/telephony/SmsConstants$MessageClass;->CLASS_0:Lcom/android/internal/telephony/SmsConstants$MessageClass;
-Lcom/android/internal/telephony/SmsConstants$MessageClass;->CLASS_1:Lcom/android/internal/telephony/SmsConstants$MessageClass;
-Lcom/android/internal/telephony/SmsConstants$MessageClass;->CLASS_2:Lcom/android/internal/telephony/SmsConstants$MessageClass;
-Lcom/android/internal/telephony/SmsConstants$MessageClass;->CLASS_3:Lcom/android/internal/telephony/SmsConstants$MessageClass;
-Lcom/android/internal/telephony/SmsConstants$MessageClass;->UNKNOWN:Lcom/android/internal/telephony/SmsConstants$MessageClass;
 Lcom/android/internal/telephony/SmsHeader$ConcatRef;-><init>()V
-Lcom/android/internal/telephony/SmsHeader$ConcatRef;->msgCount:I
-Lcom/android/internal/telephony/SmsHeader$ConcatRef;->refNumber:I
-Lcom/android/internal/telephony/SmsHeader$ConcatRef;->seqNumber:I
 Lcom/android/internal/telephony/SmsHeader$PortAddrs;-><init>()V
-Lcom/android/internal/telephony/SmsHeader$PortAddrs;->destPort:I
-Lcom/android/internal/telephony/SmsHeader$PortAddrs;->origPort:I
-Lcom/android/internal/telephony/SmsHeader;-><init>()V
-Lcom/android/internal/telephony/SmsHeader;->concatRef:Lcom/android/internal/telephony/SmsHeader$ConcatRef;
-Lcom/android/internal/telephony/SmsHeader;->fromByteArray([B)Lcom/android/internal/telephony/SmsHeader;
-Lcom/android/internal/telephony/SmsHeader;->languageShiftTable:I
-Lcom/android/internal/telephony/SmsHeader;->languageTable:I
-Lcom/android/internal/telephony/SmsHeader;->portAddrs:Lcom/android/internal/telephony/SmsHeader$PortAddrs;
-Lcom/android/internal/telephony/SmsHeader;->toByteArray(Lcom/android/internal/telephony/SmsHeader;)[B
-Lcom/android/internal/telephony/SmsMessageBase$SubmitPduBase;->encodedMessage:[B
-Lcom/android/internal/telephony/SmsMessageBase$SubmitPduBase;->encodedScAddress:[B
 Lcom/android/internal/telephony/SmsMessageBase;-><init>()V
-Lcom/android/internal/telephony/SmsMessageBase;->getDisplayMessageBody()Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->getDisplayOriginatingAddress()Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->getMessageBody()Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->getOriginatingAddress()Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->getProtocolIdentifier()I
-Lcom/android/internal/telephony/SmsMessageBase;->getPseudoSubject()Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->getServiceCenterAddress()Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->getStatus()I
-Lcom/android/internal/telephony/SmsMessageBase;->getTimestampMillis()J
-Lcom/android/internal/telephony/SmsMessageBase;->getUserData()[B
-Lcom/android/internal/telephony/SmsMessageBase;->getUserDataHeader()Lcom/android/internal/telephony/SmsHeader;
-Lcom/android/internal/telephony/SmsMessageBase;->isReplace()Z
-Lcom/android/internal/telephony/SmsMessageBase;->isReplyPathPresent()Z
-Lcom/android/internal/telephony/SmsMessageBase;->isStatusReportMessage()Z
-Lcom/android/internal/telephony/SmsMessageBase;->mIsMwi:Z
-Lcom/android/internal/telephony/SmsMessageBase;->mMessageBody:Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->mMessageRef:I
-Lcom/android/internal/telephony/SmsMessageBase;->mMwiDontStore:Z
-Lcom/android/internal/telephony/SmsMessageBase;->mMwiSense:Z
-Lcom/android/internal/telephony/SmsMessageBase;->mOriginatingAddress:Lcom/android/internal/telephony/SmsAddress;
-Lcom/android/internal/telephony/SmsMessageBase;->mPdu:[B
-Lcom/android/internal/telephony/SmsMessageBase;->mScAddress:Ljava/lang/String;
-Lcom/android/internal/telephony/SmsMessageBase;->mUserDataHeader:Lcom/android/internal/telephony/SmsHeader;
-Lcom/android/internal/telephony/SmsRawData;-><init>([B)V
-Lcom/android/internal/telephony/SmsRawData;->CREATOR:Landroid/os/Parcelable$Creator;
-Lcom/android/internal/telephony/SmsRawData;->getBytes()[B
 Lcom/android/internal/textservice/ITextServicesManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
 Lcom/android/internal/util/HexDump;->toHexString([BZ)Ljava/lang/String;
 Lcom/android/internal/view/BaseIWindow;-><init>()V
diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt
index 9e6abe4..54cc07a8 100644
--- a/config/hiddenapi-vendor-list.txt
+++ b/config/hiddenapi-vendor-list.txt
@@ -260,17 +260,7 @@
 Lcom/android/internal/location/ILocationProvider;->setRequest(Lcom/android/internal/location/ProviderRequest;Landroid/os/WorkSource;)V
 Lcom/android/internal/R$styleable;->NumberPicker:[I
 Lcom/android/internal/R$styleable;->TwoLineListItem:[I
-Lcom/android/internal/telephony/GsmAlphabet;->gsm7BitPackedToString([BII)Ljava/lang/String;
-Lcom/android/internal/telephony/GsmAlphabet;->stringToGsm7BitPacked(Ljava/lang/String;)[B
 Lcom/android/internal/telephony/ITelephony;->getDataEnabled(I)Z
-Lcom/android/internal/telephony/OperatorInfo$State;->CURRENT:Lcom/android/internal/telephony/OperatorInfo$State;
-Lcom/android/internal/telephony/OperatorInfo$State;->FORBIDDEN:Lcom/android/internal/telephony/OperatorInfo$State;
-Lcom/android/internal/telephony/OperatorInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
-Lcom/android/internal/telephony/OperatorInfo;->CREATOR:Landroid/os/Parcelable$Creator;
-Lcom/android/internal/telephony/OperatorInfo;->getOperatorAlphaLong()Ljava/lang/String;
-Lcom/android/internal/telephony/OperatorInfo;->getOperatorAlphaShort()Ljava/lang/String;
-Lcom/android/internal/telephony/OperatorInfo;->getOperatorNumeric()Ljava/lang/String;
-Lcom/android/internal/telephony/OperatorInfo;->getState()Lcom/android/internal/telephony/OperatorInfo$State;
 Ljava/lang/System;->arraycopy([BI[BII)V
 Ljava/net/Inet4Address;->ALL:Ljava/net/InetAddress;
 Ljava/net/Inet4Address;->ANY:Ljava/net/InetAddress;
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index f646028b4..0abe45c 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.telephony;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.database.Cursor;
@@ -83,7 +84,9 @@
      * field here, NOT name.  We're NOT always guaranteed to have a name
      * for a connection, but the number should be displayable.
      */
+    @UnsupportedAppUsage
     public String name;
+    @UnsupportedAppUsage
     public String phoneNumber;
     public String normalizedNumber;
     public String geoDescription;
@@ -95,12 +98,15 @@
 
     public String phoneLabel;
     /* Split up the phoneLabel into number type and label name */
+    @UnsupportedAppUsage
     public int    numberType;
+    @UnsupportedAppUsage
     public String numberLabel;
 
     public int photoResource;
 
     // Contact ID, which will be 0 if a contact comes from the corp CP2.
+    @UnsupportedAppUsage
     public long contactIdOrZero;
     public boolean needUpdate;
     public Uri contactRefUri;
@@ -155,6 +161,7 @@
     private boolean mIsEmergency;
     private boolean mIsVoiceMail;
 
+    @UnsupportedAppUsage
     public CallerInfo() {
         // TODO: Move all the basic initialization here?
         mIsEmergency = false;
@@ -300,6 +307,7 @@
      * @return the CallerInfo which contains the caller id for the given
      * number. The returned CallerInfo is null if no number is supplied.
      */
+    @UnsupportedAppUsage
     public static CallerInfo getCallerInfo(Context context, Uri contactRef) {
         CallerInfo info = null;
         ContentResolver cr = CallerInfoAsyncQuery.getCurrentProfileContentResolver(context);
@@ -324,6 +332,7 @@
      * a matching number is not found, then a generic caller info is returned,
      * with all relevant fields empty or null.
      */
+    @UnsupportedAppUsage
     public static CallerInfo getCallerInfo(Context context, String number) {
         if (VDBG) Rlog.v(TAG, "getCallerInfo() based on number...");
 
@@ -342,6 +351,7 @@
      * a matching number is not found, then a generic caller info is returned,
      * with all relevant fields empty or null.
      */
+    @UnsupportedAppUsage
     public static CallerInfo getCallerInfo(Context context, String number, int subId) {
 
         if (TextUtils.isEmpty(number)) {
diff --git a/telephony/java/com/android/internal/telephony/EncodeException.java b/telephony/java/com/android/internal/telephony/EncodeException.java
index 0436ba0..4e3fac1 100644
--- a/telephony/java/com/android/internal/telephony/EncodeException.java
+++ b/telephony/java/com/android/internal/telephony/EncodeException.java
@@ -16,6 +16,8 @@
 
 package com.android.internal.telephony;
 
+import android.annotation.UnsupportedAppUsage;
+
 /**
  * {@hide}
  */
@@ -24,10 +26,12 @@
         super();
     }
 
+    @UnsupportedAppUsage
     public EncodeException(String s) {
         super(s);
     }
 
+    @UnsupportedAppUsage
     public EncodeException(char c) {
         super("Unencodable char: '" + c + "'");
     }
diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
index 4785169..69ff329 100644
--- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java
+++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
@@ -20,6 +20,7 @@
 import android.text.TextUtils;
 import android.util.SparseIntArray;
 
+import android.annotation.UnsupportedAppUsage;
 import android.telephony.Rlog;
 
 import java.nio.ByteBuffer;
@@ -84,6 +85,7 @@
         /**
          *The number of SMS's required to encode the text.
          */
+        @UnsupportedAppUsage
         public int msgCount;
 
         /**
@@ -92,28 +94,33 @@
          * septets for the standard ASCII and GSM encodings, and 16
          * bits for Unicode.
          */
+        @UnsupportedAppUsage
         public int codeUnitCount;
 
         /**
          * How many code units are still available without spilling
          * into an additional message.
          */
+        @UnsupportedAppUsage
         public int codeUnitsRemaining;
 
         /**
          * The encoding code unit size (specified using
          * android.telephony.SmsMessage ENCODING_*).
          */
+        @UnsupportedAppUsage
         public int codeUnitSize;
 
         /**
          * The GSM national language table to use, or 0 for the default 7-bit alphabet.
          */
+        @UnsupportedAppUsage
         public int languageTable;
 
         /**
          * The GSM national language shift table to use, or 0 for the default 7-bit extension table.
          */
+        @UnsupportedAppUsage
         public int languageShiftTable;
 
         @Override
@@ -138,6 +145,7 @@
      * @param c the character to convert
      * @return the GSM 7 bit table index for the specified character
      */
+    @UnsupportedAppUsage
     public static int
     charToGsm(char c) {
         try {
@@ -160,6 +168,7 @@
      * @throws EncodeException encode error when throwException is true
      * @return the GSM 7 bit table index for the specified character
      */
+    @UnsupportedAppUsage
     public static int
     charToGsm(char c, boolean throwException) throws EncodeException {
         int ret;
@@ -215,6 +224,7 @@
      * @param gsmChar the GSM 7 bit table index to convert
      * @return the decoded character
      */
+    @UnsupportedAppUsage
     public static char
     gsmToChar(int gsmChar) {
         if (gsmChar >= 0 && gsmChar < 128) {
@@ -293,6 +303,7 @@
      * @return Byte array containing header and encoded data.
      * @throws EncodeException if String is too large to encode
      */
+    @UnsupportedAppUsage
     public static byte[] stringToGsm7BitPackedWithHeader(String data, byte[] header,
             int languageTable, int languageShiftTable)
             throws EncodeException {
@@ -327,6 +338,7 @@
      * @return the encoded string
      * @throws EncodeException if String is too large to encode
      */
+    @UnsupportedAppUsage
     public static byte[] stringToGsm7BitPacked(String data)
             throws EncodeException {
         return stringToGsm7BitPacked(data, 0, true, 0, 0);
@@ -377,6 +389,7 @@
      *
      * @throws EncodeException if String is too large to encode
      */
+    @UnsupportedAppUsage
     public static byte[] stringToGsm7BitPacked(String data, int startingSeptetOffset,
             boolean throwException, int languageTable, int languageShiftTable)
             throws EncodeException {
@@ -428,6 +441,7 @@
      *                  (septet index * 7)
      * @param value the 7-bit character to store
      */
+    @UnsupportedAppUsage
     private static void
     packSmsChar(byte[] packedChars, int bitOffset, int value) {
         int byteOffset = bitOffset / 8;
@@ -451,6 +465,7 @@
      * @param lengthSeptets string length in septets, not bytes
      * @return String representation or null on decoding exception
      */
+    @UnsupportedAppUsage
     public static String gsm7BitPackedToString(byte[] pdu, int offset,
             int lengthSeptets) {
         return gsm7BitPackedToString(pdu, offset, lengthSeptets, 0, 0, 0);
@@ -472,6 +487,7 @@
      *     GSM extension table
      * @return String representation or null on decoding exception
      */
+    @UnsupportedAppUsage
     public static String gsm7BitPackedToString(byte[] pdu, int offset,
             int lengthSeptets, int numPaddingBits, int languageTable, int shiftTable) {
         StringBuilder ret = new StringBuilder(lengthSeptets);
@@ -555,6 +571,7 @@
      * @param length the number of bytes to decode
      * @return the decoded string
      */
+    @UnsupportedAppUsage
     public static String
     gsm8BitUnpackedToString(byte[] data, int offset, int length) {
         return gsm8BitUnpackedToString(data, offset, length, "");
@@ -570,6 +587,7 @@
      * Additionally, in some country(ex. Korea), there are non-ASCII or MBCS characters.
      * If a character set is given, characters in data are treat as MBCS.
      */
+    @UnsupportedAppUsage
     public static String
     gsm8BitUnpackedToString(byte[] data, int offset, int length, String characterset) {
         boolean isMbcs = false;
@@ -649,6 +667,7 @@
      * @param s the string to encode
      * @return the 8-bit GSM encoded byte array for the string
      */
+    @UnsupportedAppUsage
     public static byte[]
     stringToGsm8BitPacked(String s) {
         byte[] ret;
@@ -736,6 +755,7 @@
      * @return the number of septets for this character
      * @throws EncodeException the character can't be encoded and throwsException is true
      */
+    @UnsupportedAppUsage
     public static int
     countGsmSeptets(char c, boolean throwsException) throws EncodeException {
         if (sCharsToGsmTables[0].get(c, -1) != -1) {
@@ -978,6 +998,7 @@
      * @return index of first character that won't fit, or the length
      *   of the entire string if everything fits
      */
+    @UnsupportedAppUsage
     public static int
     findGsmSeptetLimitIndex(String s, int start, int limit, int langTable, int langShiftTable) {
         int accumulator = 0;
@@ -1076,18 +1097,23 @@
     }
 
     /** Reverse mapping from Unicode characters to indexes into language tables. */
+    @UnsupportedAppUsage
     private static final SparseIntArray[] sCharsToGsmTables;
 
     /** Reverse mapping from Unicode characters to indexes into language shift tables. */
+    @UnsupportedAppUsage
     private static final SparseIntArray[] sCharsToShiftTables;
 
     /** OEM configured list of enabled national language single shift tables for encoding. */
+    @UnsupportedAppUsage
     private static int[] sEnabledSingleShiftTables;
 
     /** OEM configured list of enabled national language locking shift tables for encoding. */
+    @UnsupportedAppUsage
     private static int[] sEnabledLockingShiftTables;
 
     /** Highest language code to include in array of single shift counters. */
+    @UnsupportedAppUsage
     private static int sHighestEnabledSingleShiftCode;
 
     /** Flag to bypass check for country-specific overlays (for test cases only). */
@@ -1098,9 +1124,13 @@
      * the single shift tables that it can be paired with.
      */
     private static class LanguagePairCount {
+        @UnsupportedAppUsage
         final int languageCode;
+        @UnsupportedAppUsage
         final int[] septetCounts;
+        @UnsupportedAppUsage
         final int[] unencodableCounts;
+        @UnsupportedAppUsage
         LanguagePairCount(int code) {
             this.languageCode = code;
             int maxSingleShiftCode = sHighestEnabledSingleShiftCode;
@@ -1130,6 +1160,7 @@
      * GSM default 7 bit alphabet plus national language locking shift character tables.
      * Comment lines above strings indicate the lower four bits of the table position.
      */
+    @UnsupportedAppUsage
     private static final String[] sLanguageTables = {
         /* 3GPP TS 23.038 V9.1.1 section 6.2.1 - GSM 7 bit Default Alphabet
          01.....23.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.E.....F.....0.....1 */
@@ -1323,6 +1354,7 @@
     /**
      * GSM default extension table plus national language single shift character tables.
      */
+    @UnsupportedAppUsage
     private static final String[] sLanguageShiftTables = new String[]{
         /* 6.2.1.1 GSM 7 bit Default Alphabet Extension Table
          0123456789A.....BCDEF0123456789ABCDEF0123456789ABCDEF.0123456789ABCDEF0123456789ABCDEF */
diff --git a/telephony/java/com/android/internal/telephony/OperatorInfo.java b/telephony/java/com/android/internal/telephony/OperatorInfo.java
index a29d7c1..d0245a0 100644
--- a/telephony/java/com/android/internal/telephony/OperatorInfo.java
+++ b/telephony/java/com/android/internal/telephony/OperatorInfo.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.telephony;
 
+import android.annotation.UnsupportedAppUsage;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -26,37 +27,48 @@
     public enum State {
         UNKNOWN,
         AVAILABLE,
+        @UnsupportedAppUsage
         CURRENT,
+        @UnsupportedAppUsage
         FORBIDDEN;
     }
 
+    @UnsupportedAppUsage
     private String mOperatorAlphaLong;
+    @UnsupportedAppUsage
     private String mOperatorAlphaShort;
+    @UnsupportedAppUsage
     private String mOperatorNumeric;
 
+    @UnsupportedAppUsage
     private State mState = State.UNKNOWN;
 
 
+    @UnsupportedAppUsage
     public String
     getOperatorAlphaLong() {
         return mOperatorAlphaLong;
     }
 
+    @UnsupportedAppUsage
     public String
     getOperatorAlphaShort() {
         return mOperatorAlphaShort;
     }
 
+    @UnsupportedAppUsage
     public String
     getOperatorNumeric() {
         return mOperatorNumeric;
     }
 
+    @UnsupportedAppUsage
     public State
     getState() {
         return mState;
     }
 
+    @UnsupportedAppUsage
     OperatorInfo(String operatorAlphaLong,
                 String operatorAlphaShort,
                 String operatorNumeric,
@@ -70,6 +82,7 @@
     }
 
 
+    @UnsupportedAppUsage
     public OperatorInfo(String operatorAlphaLong,
                 String operatorAlphaShort,
                 String operatorNumeric,
@@ -78,6 +91,7 @@
                 operatorNumeric, rilStateToState(stateString));
     }
 
+    @UnsupportedAppUsage
     public OperatorInfo(String operatorAlphaLong,
             String operatorAlphaShort,
             String operatorNumeric) {
@@ -87,6 +101,7 @@
     /**
      * See state strings defined in ril.h RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
      */
+    @UnsupportedAppUsage
     private static State rilStateToState(String s) {
         if (s.equals("unknown")) {
             return State.UNKNOWN;
@@ -140,6 +155,7 @@
      * Implement the Parcelable interface
      * Method to deserialize a OperatorInfo object, or an array thereof.
      */
+    @UnsupportedAppUsage
     public static final Creator<OperatorInfo> CREATOR =
         new Creator<OperatorInfo>() {
             @Override
diff --git a/telephony/java/com/android/internal/telephony/SmsAddress.java b/telephony/java/com/android/internal/telephony/SmsAddress.java
index b3892cb..2a8de8c 100644
--- a/telephony/java/com/android/internal/telephony/SmsAddress.java
+++ b/telephony/java/com/android/internal/telephony/SmsAddress.java
@@ -16,6 +16,8 @@
 
 package com.android.internal.telephony;
 
+import android.annotation.UnsupportedAppUsage;
+
 public abstract class SmsAddress {
     // From TS 23.040 9.1.2.5 and TS 24.008 table 10.5.118
     // and C.S0005-D table 2.7.1.3.2.4-2
@@ -29,6 +31,7 @@
 
     public int ton;
     public String address;
+    @UnsupportedAppUsage
     public byte[] origBytes;
 
     /**
diff --git a/telephony/java/com/android/internal/telephony/SmsConstants.java b/telephony/java/com/android/internal/telephony/SmsConstants.java
index 0aba468..19f52b0 100644
--- a/telephony/java/com/android/internal/telephony/SmsConstants.java
+++ b/telephony/java/com/android/internal/telephony/SmsConstants.java
@@ -15,6 +15,8 @@
  */
 package com.android.internal.telephony;
 
+import android.annotation.UnsupportedAppUsage;
+
 /**
  * SMS Constants and must be the same as the corresponding
  * deprecated version in SmsMessage.
@@ -58,10 +60,15 @@
      * See TS 23.038.
      */
     public enum MessageClass{
+        @UnsupportedAppUsage
         UNKNOWN,
+        @UnsupportedAppUsage
         CLASS_0,
+        @UnsupportedAppUsage
         CLASS_1,
+        @UnsupportedAppUsage
         CLASS_2,
+        @UnsupportedAppUsage
         CLASS_3;
     }
 
diff --git a/telephony/java/com/android/internal/telephony/SmsHeader.java b/telephony/java/com/android/internal/telephony/SmsHeader.java
index b519b70..9fe1718 100644
--- a/telephony/java/com/android/internal/telephony/SmsHeader.java
+++ b/telephony/java/com/android/internal/telephony/SmsHeader.java
@@ -22,6 +22,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
+import android.annotation.UnsupportedAppUsage;
 import java.util.ArrayList;
 
 /**
@@ -72,14 +73,19 @@
     public static final int PORT_WAP_WSP  = 9200;
 
     public static class PortAddrs {
+        @UnsupportedAppUsage
         public int destPort;
+        @UnsupportedAppUsage
         public int origPort;
         public boolean areEightBits;
     }
 
     public static class ConcatRef {
+        @UnsupportedAppUsage
         public int refNumber;
+        @UnsupportedAppUsage
         public int seqNumber;
+        @UnsupportedAppUsage
         public int msgCount;
         public boolean isEightBits;
     }
@@ -98,17 +104,22 @@
         public byte[] data;
     }
 
+    @UnsupportedAppUsage
     public PortAddrs portAddrs;
+    @UnsupportedAppUsage
     public ConcatRef concatRef;
     public ArrayList<SpecialSmsMsg> specialSmsMsgList = new ArrayList<SpecialSmsMsg>();
     public ArrayList<MiscElt> miscEltList = new ArrayList<MiscElt>();
 
     /** 7 bit national language locking shift table, or 0 for GSM default 7 bit alphabet. */
+    @UnsupportedAppUsage
     public int languageTable;
 
     /** 7 bit national language single shift table, or 0 for GSM default 7 bit extension table. */
+    @UnsupportedAppUsage
     public int languageShiftTable;
 
+    @UnsupportedAppUsage
     public SmsHeader() {}
 
     /**
@@ -117,6 +128,7 @@
      * @param data is user data header bytes
      * @return SmsHeader object
      */
+    @UnsupportedAppUsage
     public static SmsHeader fromByteArray(byte[] data) {
         ByteArrayInputStream inStream = new ByteArrayInputStream(data);
         SmsHeader smsHeader = new SmsHeader();
@@ -198,6 +210,7 @@
      * (see TS 23.040 9.2.3.24)
      * @return Byte array representing the SmsHeader
      */
+    @UnsupportedAppUsage
     public static byte[] toByteArray(SmsHeader smsHeader) {
         if ((smsHeader.portAddrs == null) &&
             (smsHeader.concatRef == null) &&
diff --git a/telephony/java/com/android/internal/telephony/SmsMessageBase.java b/telephony/java/com/android/internal/telephony/SmsMessageBase.java
index e5821dc..7b1ead9 100644
--- a/telephony/java/com/android/internal/telephony/SmsMessageBase.java
+++ b/telephony/java/com/android/internal/telephony/SmsMessageBase.java
@@ -22,6 +22,7 @@
 import java.text.BreakIterator;
 import java.util.Arrays;
 
+import android.annotation.UnsupportedAppUsage;
 import android.provider.Telephony;
 import android.telephony.SmsMessage;
 import android.text.Emoji;
@@ -32,12 +33,15 @@
  */
 public abstract class SmsMessageBase {
     /** {@hide} The address of the SMSC. May be null */
+    @UnsupportedAppUsage
     protected String mScAddress;
 
     /** {@hide} The address of the sender */
+    @UnsupportedAppUsage
     protected SmsAddress mOriginatingAddress;
 
     /** {@hide} The message body as a string. May be null if the message isn't text */
+    @UnsupportedAppUsage
     protected String mMessageBody;
 
     /** {@hide} */
@@ -56,23 +60,28 @@
     protected long mScTimeMillis;
 
     /** {@hide} The raw PDU of the message */
+    @UnsupportedAppUsage
     protected byte[] mPdu;
 
     /** {@hide} The raw bytes for the user data section of the message */
     protected byte[] mUserData;
 
     /** {@hide} */
+    @UnsupportedAppUsage
     protected SmsHeader mUserDataHeader;
 
     // "Message Waiting Indication Group"
     // 23.038 Section 4
     /** {@hide} */
+    @UnsupportedAppUsage
     protected boolean mIsMwi;
 
     /** {@hide} */
+    @UnsupportedAppUsage
     protected boolean mMwiSense;
 
     /** {@hide} */
+    @UnsupportedAppUsage
     protected boolean mMwiDontStore;
 
     /**
@@ -86,11 +95,14 @@
     protected int mIndexOnIcc = -1;
 
     /** TP-Message-Reference - Message Reference of sent message. @hide */
+    @UnsupportedAppUsage
     public int mMessageRef;
 
     // TODO(): This class is duplicated in SmsMessage.java. Refactor accordingly.
     public static abstract class SubmitPduBase  {
+        @UnsupportedAppUsage
         public byte[] encodedScAddress; // Null if not applicable.
+        @UnsupportedAppUsage
         public byte[] encodedMessage;
 
         @Override
@@ -106,6 +118,7 @@
      * Returns the address of the SMS service center that relayed this message
      * or null if there is none.
      */
+    @UnsupportedAppUsage
     public String getServiceCenterAddress() {
         return mScAddress;
     }
@@ -114,6 +127,7 @@
      * Returns the originating address (sender) of this SMS message in String
      * form or null if unavailable
      */
+    @UnsupportedAppUsage
     public String getOriginatingAddress() {
         if (mOriginatingAddress == null) {
             return null;
@@ -127,6 +141,7 @@
      * was from an email gateway. Returns null if originating address
      * unavailable.
      */
+    @UnsupportedAppUsage
     public String getDisplayOriginatingAddress() {
         if (mIsEmail) {
             return mEmailFrom;
@@ -139,6 +154,7 @@
      * Returns the message body as a String, if it exists and is text based.
      * @return message body is there is one, otherwise null
      */
+    @UnsupportedAppUsage
     public String getMessageBody() {
         return mMessageBody;
     }
@@ -152,6 +168,7 @@
      * Returns the message body, or email message body if this message was from
      * an email gateway. Returns null if message body unavailable.
      */
+    @UnsupportedAppUsage
     public String getDisplayMessageBody() {
         if (mIsEmail) {
             return mEmailBody;
@@ -164,6 +181,7 @@
      * Unofficial convention of a subject line enclosed in parens empty string
      * if not present
      */
+    @UnsupportedAppUsage
     public String getPseudoSubject() {
         return mPseudoSubject == null ? "" : mPseudoSubject;
     }
@@ -171,6 +189,7 @@
     /**
      * Returns the service centre timestamp in currentTimeMillis() format
      */
+    @UnsupportedAppUsage
     public long getTimestampMillis() {
         return mScTimeMillis;
     }
@@ -204,12 +223,14 @@
     /**
      * Get protocol identifier.
      */
+    @UnsupportedAppUsage
     public abstract int getProtocolIdentifier();
 
     /**
      * See TS 23.040 9.2.3.9 returns true if this is a "replace short message"
      * SMS
      */
+    @UnsupportedAppUsage
     public abstract boolean isReplace();
 
     /**
@@ -242,6 +263,7 @@
      * returns the user data section minus the user data header if one was
      * present.
      */
+    @UnsupportedAppUsage
     public byte[] getUserData() {
         return mUserData;
     }
@@ -251,6 +273,7 @@
      *
      * {@hide}
      */
+    @UnsupportedAppUsage
     public SmsHeader getUserDataHeader() {
         return mUserDataHeader;
     }
@@ -279,17 +302,20 @@
      *         See TS 23.040, 9.9.2.3.15 for a description of other possible
      *         values.
      */
+    @UnsupportedAppUsage
     public abstract int getStatus();
 
     /**
      * Return true iff the message is a SMS-STATUS-REPORT message.
      */
+    @UnsupportedAppUsage
     public abstract boolean isStatusReportMessage();
 
     /**
      * Returns true iff the <code>TP-Reply-Path</code> bit is set in
      * this message.
      */
+    @UnsupportedAppUsage
     public abstract boolean isReplyPathPresent();
 
     /**
diff --git a/telephony/java/com/android/internal/telephony/SmsRawData.java b/telephony/java/com/android/internal/telephony/SmsRawData.java
index 891d942..18727f3 100644
--- a/telephony/java/com/android/internal/telephony/SmsRawData.java
+++ b/telephony/java/com/android/internal/telephony/SmsRawData.java
@@ -17,6 +17,7 @@
 
 package com.android.internal.telephony;
 
+import android.annotation.UnsupportedAppUsage;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -27,6 +28,7 @@
     byte[] data;
 
     //Static Methods
+    @UnsupportedAppUsage
     public static final Parcelable.Creator<SmsRawData> CREATOR
             = new Parcelable.Creator<SmsRawData> (){
         public SmsRawData createFromParcel(Parcel source) {
@@ -43,10 +45,12 @@
     };
 
     // Constructor
+    @UnsupportedAppUsage
     public SmsRawData(byte[] data) {
         this.data = data;
     }
 
+    @UnsupportedAppUsage
     public byte[] getBytes() {
         return data;
     }