diff options
author | Mathew Inwood <mathewi@google.com> | 2020-10-27 11:47:29 +0000 |
---|---|---|
committer | Mathew Inwood <mathewi@google.com> | 2020-10-27 15:46:07 +0000 |
commit | 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6 (patch) | |
tree | b63a80a2c05239699b1600245ad2648d8ac98102 /telephony/common | |
parent | 69bca6a5132e9e00dd069ab4c2e1e17d892fab7d (diff) |
Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
Diffstat (limited to 'telephony/common')
14 files changed, 38 insertions, 24 deletions
diff --git a/telephony/common/com/android/internal/telephony/SmsApplication.java b/telephony/common/com/android/internal/telephony/SmsApplication.java index c3cd01738b96..96996a1ae8ac 100644 --- a/telephony/common/com/android/internal/telephony/SmsApplication.java +++ b/telephony/common/com/android/internal/telephony/SmsApplication.java @@ -35,6 +35,7 @@ import android.content.pm.ServiceInfo; import android.net.Uri; import android.os.AsyncTask; import android.os.Binder; +import android.os.Build; import android.os.Process; import android.os.UserHandle; import android.provider.Telephony; @@ -89,7 +90,7 @@ public final class SmsApplication { /** * Name of this SMS app for display. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private String mApplicationName; /** @@ -580,7 +581,7 @@ public final class SmsApplication { * Sets the specified package as the default SMS/MMS application. The caller of this method * needs to have permission to set AppOps and write to secure settings. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static void setDefaultApplication(String packageName, Context context) { setDefaultApplicationAsUser(packageName, context, getIncomingUserId(context)); } @@ -849,7 +850,7 @@ public final class SmsApplication { sSmsPackageMonitor.register(context, context.getMainLooper(), UserHandle.ALL); } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private static void configurePreferredActivity(PackageManager packageManager, ComponentName componentName) { // Add the four activity preferences we want to direct to this app. @@ -887,7 +888,7 @@ public final class SmsApplication { * Returns SmsApplicationData for this package if this package is capable of being set as the * default SMS application. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static SmsApplicationData getSmsApplicationData(String packageName, Context context) { Collection<SmsApplicationData> applications = getApplicationCollection(context); return getApplicationForPackage(applications, packageName); @@ -959,7 +960,7 @@ public final class SmsApplication { * @param updateIfNeeded update the default app if there is no valid default app configured. * @return component name of the app and class to direct Respond Via Message intent to */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static ComponentName getDefaultRespondViaMessageApplication(Context context, boolean updateIfNeeded) { int userId = getIncomingUserId(context); @@ -1060,7 +1061,7 @@ public final class SmsApplication { * <p> * Caller must pass in the correct user context if calling from a singleton service. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static boolean shouldWriteMessageForPackage(String packageName, Context context) { return !isDefaultSmsApplication(context, packageName); } diff --git a/telephony/common/com/google/android/mms/ContentType.java b/telephony/common/com/google/android/mms/ContentType.java index 4a971dd34c8f..2aec86fe67e4 100644 --- a/telephony/common/com/google/android/mms/ContentType.java +++ b/telephony/common/com/google/android/mms/ContentType.java @@ -18,6 +18,7 @@ package com.google.android.mms; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import java.util.ArrayList; @@ -176,17 +177,17 @@ public class ContentType { return (null != contentType) && sSupportedContentTypes.contains(contentType); } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static boolean isSupportedImageType(String contentType) { return isImageType(contentType) && isSupportedType(contentType); } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static boolean isSupportedAudioType(String contentType) { return isAudioType(contentType) && isSupportedType(contentType); } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static boolean isSupportedVideoType(String contentType) { return isVideoType(contentType) && isSupportedType(contentType); } diff --git a/telephony/common/com/google/android/mms/MmsException.java b/telephony/common/com/google/android/mms/MmsException.java index 24bceb37f590..db6d1d1e3d8a 100644 --- a/telephony/common/com/google/android/mms/MmsException.java +++ b/telephony/common/com/google/android/mms/MmsException.java @@ -18,6 +18,7 @@ package com.google.android.mms; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; /** * A generic exception that is thrown by the Mms client. @@ -59,7 +60,7 @@ public class MmsException extends Exception { * @param message the detail message. * @param cause the cause. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public MmsException(String message, Throwable cause) { super(message, cause); } diff --git a/telephony/common/com/google/android/mms/pdu/AcknowledgeInd.java b/telephony/common/com/google/android/mms/pdu/AcknowledgeInd.java index 8693385bb032..3eda60bfbf1f 100644 --- a/telephony/common/com/google/android/mms/pdu/AcknowledgeInd.java +++ b/telephony/common/com/google/android/mms/pdu/AcknowledgeInd.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import com.google.android.mms.InvalidHeaderValueException; @@ -68,7 +69,7 @@ public class AcknowledgeInd extends GenericPdu { * @param value the value * @throws InvalidHeaderValueException if the value is invalid. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public void setReportAllowed(int value) throws InvalidHeaderValueException { mPduHeaders.setOctet(value, PduHeaders.REPORT_ALLOWED); } diff --git a/telephony/common/com/google/android/mms/pdu/DeliveryInd.java b/telephony/common/com/google/android/mms/pdu/DeliveryInd.java index 8fb6a7545abf..ca1f2ebeb044 100644 --- a/telephony/common/com/google/android/mms/pdu/DeliveryInd.java +++ b/telephony/common/com/google/android/mms/pdu/DeliveryInd.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import com.google.android.mms.InvalidHeaderValueException; @@ -53,7 +54,7 @@ public class DeliveryInd extends GenericPdu { * * @return the value */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public long getDate() { return mPduHeaders.getLongInteger(PduHeaders.DATE); } diff --git a/telephony/common/com/google/android/mms/pdu/EncodedStringValue.java b/telephony/common/com/google/android/mms/pdu/EncodedStringValue.java index 8c0380f77cdd..8b01cb3c4405 100644 --- a/telephony/common/com/google/android/mms/pdu/EncodedStringValue.java +++ b/telephony/common/com/google/android/mms/pdu/EncodedStringValue.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import android.util.Log; import java.io.ByteArrayOutputStream; @@ -237,7 +238,7 @@ public class EncodedStringValue implements Cloneable { /** * Extract an EncodedStringValue[] from a given String. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static EncodedStringValue[] extract(String src) { String[] values = src.split(";"); diff --git a/telephony/common/com/google/android/mms/pdu/MultimediaMessagePdu.java b/telephony/common/com/google/android/mms/pdu/MultimediaMessagePdu.java index 42a89c69e873..45ba4819aa24 100644 --- a/telephony/common/com/google/android/mms/pdu/MultimediaMessagePdu.java +++ b/telephony/common/com/google/android/mms/pdu/MultimediaMessagePdu.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import com.google.android.mms.InvalidHeaderValueException; @@ -116,7 +117,7 @@ public class MultimediaMessagePdu extends GenericPdu{ * @param value the value * @throws NullPointerException if the value is null. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public void addTo(EncodedStringValue value) { mPduHeaders.appendEncodedStringValue(value, PduHeaders.TO); } @@ -137,7 +138,7 @@ public class MultimediaMessagePdu extends GenericPdu{ * @param value the value * @throws InvalidHeaderValueException if the value is invalid. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public void setPriority(int value) throws InvalidHeaderValueException { mPduHeaders.setOctet(value, PduHeaders.PRIORITY); } @@ -157,7 +158,7 @@ public class MultimediaMessagePdu extends GenericPdu{ * * @param value the value */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public void setDate(long value) { mPduHeaders.setLongInteger(value, PduHeaders.DATE); } diff --git a/telephony/common/com/google/android/mms/pdu/NotifyRespInd.java b/telephony/common/com/google/android/mms/pdu/NotifyRespInd.java index ebd81afc0173..16d83953e723 100644 --- a/telephony/common/com/google/android/mms/pdu/NotifyRespInd.java +++ b/telephony/common/com/google/android/mms/pdu/NotifyRespInd.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import com.google.android.mms.InvalidHeaderValueException; @@ -72,7 +73,7 @@ public class NotifyRespInd extends GenericPdu { * @throws InvalidHeaderValueException if the value is invalid. * RuntimeException if an undeclared error occurs. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public void setReportAllowed(int value) throws InvalidHeaderValueException { mPduHeaders.setOctet(value, PduHeaders.REPORT_ALLOWED); } diff --git a/telephony/common/com/google/android/mms/pdu/PduBody.java b/telephony/common/com/google/android/mms/pdu/PduBody.java index f7f285f653b9..e76738b5a42f 100644 --- a/telephony/common/com/google/android/mms/pdu/PduBody.java +++ b/telephony/common/com/google/android/mms/pdu/PduBody.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import java.util.HashMap; import java.util.Map; @@ -113,7 +114,7 @@ public class PduBody { * @param index index of the part to return * @return part at the specified index */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public PduPart removePart(int index) { return mParts.remove(index); } @@ -142,7 +143,7 @@ public class PduBody { * @param part the part object * @return index the index of the first occurrence of the part in this body */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public int getPartIndex(PduPart part) { return mParts.indexOf(part); } diff --git a/telephony/common/com/google/android/mms/pdu/PduPart.java b/telephony/common/com/google/android/mms/pdu/PduPart.java index 8dd976b2569f..aead141634e8 100644 --- a/telephony/common/com/google/android/mms/pdu/PduPart.java +++ b/telephony/common/com/google/android/mms/pdu/PduPart.java @@ -19,6 +19,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; import android.net.Uri; +import android.os.Build; import java.util.HashMap; import java.util.Map; @@ -164,7 +165,7 @@ public class PduPart { /** * @return The length of the data, if this object have data, else 0. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public int getDataLength() { if(mPartData != null){ return mPartData.length; diff --git a/telephony/common/com/google/android/mms/pdu/SendReq.java b/telephony/common/com/google/android/mms/pdu/SendReq.java index 6e2f2da01791..8b5a61701377 100644 --- a/telephony/common/com/google/android/mms/pdu/SendReq.java +++ b/telephony/common/com/google/android/mms/pdu/SendReq.java @@ -18,6 +18,7 @@ package com.google.android.mms.pdu; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import android.util.Log; import com.google.android.mms.InvalidHeaderValueException; @@ -150,7 +151,7 @@ public class SendReq extends MultimediaMessagePdu { * @param value the value * @throws NullPointerException if the value is null. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public void setCc(EncodedStringValue[] value) { mPduHeaders.setEncodedStringValues(value, PduHeaders.CC); } diff --git a/telephony/common/com/google/android/mms/util/AbstractCache.java b/telephony/common/com/google/android/mms/util/AbstractCache.java index 25862e73581e..8b9ee43b0981 100644 --- a/telephony/common/com/google/android/mms/util/AbstractCache.java +++ b/telephony/common/com/google/android/mms/util/AbstractCache.java @@ -18,6 +18,7 @@ package com.google.android.mms.util; import android.compat.annotation.UnsupportedAppUsage; +import android.os.Build; import android.util.Log; import java.util.HashMap; @@ -64,7 +65,7 @@ public abstract class AbstractCache<K, V> { return false; } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public V get(K key) { if (LOCAL_LOGV) { Log.v(TAG, "Trying to get " + key + " from cache."); diff --git a/telephony/common/com/google/android/mms/util/DownloadDrmHelper.java b/telephony/common/com/google/android/mms/util/DownloadDrmHelper.java index 0f9390daa725..d0e33984e094 100644 --- a/telephony/common/com/google/android/mms/util/DownloadDrmHelper.java +++ b/telephony/common/com/google/android/mms/util/DownloadDrmHelper.java @@ -20,6 +20,7 @@ package com.google.android.mms.util; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.drm.DrmManagerClient; +import android.os.Build; import android.util.Log; public class DownloadDrmHelper { @@ -73,7 +74,7 @@ public class DownloadDrmHelper { * Modifies the file extension for a DRM Forward Lock file NOTE: This * function shouldn't be called if the file shouldn't be DRM converted */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static String modifyDrmFwLockFileExtension(String filename) { if (filename != null) { int extensionIndex; diff --git a/telephony/common/com/google/android/mms/util/SqliteWrapper.java b/telephony/common/com/google/android/mms/util/SqliteWrapper.java index 31fe4d7683d6..e2d62f868d52 100644 --- a/telephony/common/com/google/android/mms/util/SqliteWrapper.java +++ b/telephony/common/com/google/android/mms/util/SqliteWrapper.java @@ -25,6 +25,7 @@ import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteException; import android.net.Uri; +import android.os.Build; import android.util.Log; import android.widget.Toast; @@ -79,7 +80,7 @@ public final class SqliteWrapper { } } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static boolean requery(Context context, Cursor cursor) { try { return cursor.requery(); |