Merge "[Telephony Mainline] Add new SystemApi method and SystemApi annotation for mainline"

This commit is contained in:
Betty Chang
2019-12-24 12:05:02 +00:00
committed by Android (Google) Code Review
5 changed files with 33 additions and 6 deletions

View File

@@ -45753,6 +45753,7 @@ package android.telephony {
method public byte[] getPdu();
method public int getProtocolIdentifier();
method public String getPseudoSubject();
method @Nullable public String getRecipientAddress();
method public String getServiceCenterAddress();
method public int getStatus();
method public int getStatusOnIcc();

View File

@@ -8,6 +8,7 @@ package android {
field public static final String ACCESS_DRM_CERTIFICATES = "android.permission.ACCESS_DRM_CERTIFICATES";
field @Deprecated public static final String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO";
field public static final String ACCESS_INSTANT_APPS = "android.permission.ACCESS_INSTANT_APPS";
field public static final String ACCESS_MESSAGES_ON_ICC = "android.permission.ACCESS_MESSAGES_ON_ICC";
field public static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION";
field public static final String ACCESS_MTP = "android.permission.ACCESS_MTP";
field public static final String ACCESS_NETWORK_CONDITIONS = "android.permission.ACCESS_NETWORK_CONDITIONS";
@@ -9865,8 +9866,10 @@ package android.telephony {
}
public final class SmsManager {
method @RequiresPermission(android.Manifest.permission.ACCESS_MESSAGES_ON_ICC) public boolean deleteMessageFromIcc(int);
method public boolean disableCellBroadcastRange(int, int, int);
method public boolean enableCellBroadcastRange(int, int, int);
method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_MESSAGES_ON_ICC) public java.util.List<android.telephony.SmsMessage> getMessagesFromIcc();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSmsCapacityOnIcc();
method public void sendMultipartTextMessage(@NonNull String, @NonNull String, @NonNull java.util.List<java.lang.String>, @Nullable java.util.List<android.app.PendingIntent>, @Nullable java.util.List<android.app.PendingIntent>, @NonNull String);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void sendMultipartTextMessageWithoutPersisting(String, String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>);

View File

@@ -726,6 +726,11 @@
<!-- ====================================================================== -->
<eat-comment />
<!-- @SystemApi Allows accessing the messages on ICC
@hide Used internally. -->
<permission android:name="android.permission.ACCESS_MESSAGES_ON_ICC"
android:protectionLevel="signature|telephony" />
<!-- Used for runtime permissions related to user's SMS messages. -->
<permission-group android:name="android.permission-group.SMS"
android:icon="@drawable/perm_group_sms"

View File

@@ -16,6 +16,7 @@
package android.telephony;
import android.Manifest;
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -1635,14 +1636,16 @@ public final class SmsManager {
* operation is performed on the correct subscription.
* </p>
*
* @param messageIndex is the record index of the message on ICC
* @return true for success
* @param messageIndex This is the same index used to access a message
* from {@link #getMessagesFromIcc()}.
* @return true for success, false if the operation fails. Failure can be due to IPC failure,
* RIL/modem error which results in SMS failed to be deleted on SIM
*
* {@hide}
*/
@UnsupportedAppUsage
public boolean
deleteMessageFromIcc(int messageIndex) {
@SystemApi
@RequiresPermission(Manifest.permission.ACCESS_MESSAGES_ON_ICC)
public boolean deleteMessageFromIcc(int messageIndex) {
boolean success = false;
try {
@@ -1684,6 +1687,7 @@ public final class SmsManager {
* {@hide}
*/
@UnsupportedAppUsage
@RequiresPermission(Manifest.permission.ACCESS_MESSAGES_ON_ICC)
public boolean updateMessageOnIcc(int messageIndex, int newStatus, byte[] pdu) {
boolean success = false;
@@ -1716,8 +1720,22 @@ public final class SmsManager {
* operation is performed on the correct subscription.
* </p>
*
* @return <code>List</code> of <code>SmsMessage</code> objects
*
* {@hide}
*/
@SystemApi
@RequiresPermission(Manifest.permission.ACCESS_MESSAGES_ON_ICC)
public @NonNull List<SmsMessage> getMessagesFromIcc() {
return getAllMessagesFromIcc();
}
/**
* @return <code>ArrayList</code> of <code>SmsMessage</code> objects
*
* This is similar to {@link #getMessagesFromIcc} except that it will return ArrayList.
* Suggested to use {@link #getMessagesFromIcc} instead.
*
* {@hide}
*/
@UnsupportedAppUsage

View File

@@ -1038,10 +1038,10 @@ public class SmsMessage {
}
/**
* {@hide}
* Returns the recipient address(receiver) of this SMS message in String form or null if
* unavailable.
*/
@Nullable
public String getRecipientAddress() {
return mWrappedSmsMessage.getRecipientAddress();
}