summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java37
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl10
2 files changed, 47 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 3249989..a0a0fb3 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -18,6 +18,7 @@ package android.telephony;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.Manifest;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.ActivityThread;
@@ -31,6 +32,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.telecom.PhoneAccount;
+import android.text.TextUtils;
import android.util.Log;
import com.android.internal.telecom.ITelecomService;
@@ -45,6 +47,7 @@ import com.android.internal.telephony.TelephonyProperties;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -2942,6 +2945,40 @@ public class TelephonyManager {
}
/**
+ * Allows an application to add a protected sms address if the application has
+ * been granted the permission MODIFY_PROTECTED_SMS_LIST.
+ * @param address
+ * @hide
+ */
+ public void addProtectedSmsAddress(String address) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.MODIFY_PROTECTED_SMS_LIST, null);
+ try {
+ getITelephony().addProtectedSmsAddress(address);
+ } catch (RemoteException ex) {
+ } catch (NullPointerException ex) {
+ }
+ }
+
+ /**
+ * Allows an application to revoke/remove a protected sms address if the application has been
+ * granted the permission MODIFY_PROTECTED_SMS_LIST.
+ * @param address
+ * @return true if address is successfully removed
+ * @hide
+ */
+ public boolean revokeProtectedSmsAddress(String address) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.MODIFY_PROTECTED_SMS_LIST, null);
+ try {
+ return getITelephony().revokeProtectedSmsAddress(address);
+ } catch (RemoteException ex) {
+ } catch (NullPointerException ex) {
+ }
+ return false;
+ }
+
+ /**
* Returns the MMS user agent.
*/
public String getMmsUserAgent() {
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 6e0ac88..5c05191 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -545,6 +545,16 @@ interface ITelephony {
int getLteOnGsmMode();
/**
+ * Adds a protected sms address to the {@link Settings.Secure.PROTECTED_SMS_ADDRESSES}
+ */
+ void addProtectedSmsAddress(String address);
+
+ /**
+ * Revokes a protected sms address from {@link Settings.Secure.PROTECTED_SMS_ADDRESSES}
+ */
+ boolean revokeProtectedSmsAddress(String address);
+
+ /**
* get default sim
* @return sim id
*/