From 1acbb9c031c6eebde0fc5d84e3d939c2596a9de4 Mon Sep 17 00:00:00 2001 From: zoey chen Date: Thu, 7 Nov 2019 11:48:01 +0800 Subject: [PATCH] [Telephony mainline] Add SystemApi and NonNull annotation Bug: 143860012 Test: make Change-Id: I619d6ba04cb28830e3995feb02ffcb592ff65818 Merged-In: I619d6ba04cb28830e3995feb02ffcb592ff65818 --- api/system-current.txt | 12 +++++ .../provider/BlockedNumberContract.java | 48 +++++++++++++------ 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index a135f55b04283..6a7e6d6e95823 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6153,6 +6153,18 @@ package android.printservice.recommendation { package android.provider { + public class BlockedNumberContract { + field public static final String METHOD_NOTIFY_EMERGENCY_CONTACT = "notify_emergency_contact"; + field public static final String METHOD_SHOULD_SYSTEM_BLOCK_NUMBER = "should_system_block_number"; + field public static final String RES_BLOCK_STATUS = "block_status"; + field public static final int STATUS_BLOCKED_IN_LIST = 1; // 0x1 + field public static final int STATUS_BLOCKED_NOT_IN_CONTACTS = 5; // 0x5 + field public static final int STATUS_BLOCKED_PAYPHONE = 4; // 0x4 + field public static final int STATUS_BLOCKED_RESTRICTED = 2; // 0x2 + field public static final int STATUS_BLOCKED_UNKNOWN_NUMBER = 3; // 0x3 + field public static final int STATUS_NOT_BLOCKED = 0; // 0x0 + } + public static final class ContactsContract.MetadataSync implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncColumns { field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata"; field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata"; diff --git a/core/java/android/provider/BlockedNumberContract.java b/core/java/android/provider/BlockedNumberContract.java index dd2ea81d747bc..1eb76648f7b2b 100644 --- a/core/java/android/provider/BlockedNumberContract.java +++ b/core/java/android/provider/BlockedNumberContract.java @@ -16,6 +16,7 @@ package android.provider; import android.annotation.IntDef; +import android.annotation.SystemApi; import android.annotation.WorkerThread; import android.content.Context; import android.net.Uri; @@ -239,6 +240,7 @@ public class BlockedNumberContract { * blocked. * @hide */ + @SystemApi public static final int STATUS_NOT_BLOCKED = 0; /** @@ -246,6 +248,7 @@ public class BlockedNumberContract { * because it is in the list of blocked numbers maintained by the provider. * @hide */ + @SystemApi public static final int STATUS_BLOCKED_IN_LIST = 1; /** @@ -253,6 +256,7 @@ public class BlockedNumberContract { * because it is from a restricted number. * @hide */ + @SystemApi public static final int STATUS_BLOCKED_RESTRICTED = 2; /** @@ -260,6 +264,7 @@ public class BlockedNumberContract { * because it is from an unknown number. * @hide */ + @SystemApi public static final int STATUS_BLOCKED_UNKNOWN_NUMBER = 3; /** @@ -267,6 +272,7 @@ public class BlockedNumberContract { * because it is from a pay phone. * @hide */ + @SystemApi public static final int STATUS_BLOCKED_PAYPHONE = 4; /** @@ -274,12 +280,14 @@ public class BlockedNumberContract { * because it is from a number not in the users contacts. * @hide */ + @SystemApi public static final int STATUS_BLOCKED_NOT_IN_CONTACTS = 5; /** * Integer reason indicating whether a call was blocked, and if so why. * @hide */ + @SystemApi public static final String RES_BLOCK_STATUS = "block_status"; /** @hide */ @@ -289,6 +297,31 @@ public class BlockedNumberContract { public static final String METHOD_CAN_CURRENT_USER_BLOCK_NUMBERS = "can_current_user_block_numbers"; + /** @hide */ + @SystemApi + public static final String METHOD_NOTIFY_EMERGENCY_CONTACT = "notify_emergency_contact"; + + /** @hide */ + public static final String METHOD_END_BLOCK_SUPPRESSION = "end_block_suppression"; + + /** @hide */ + @SystemApi + public static final String METHOD_SHOULD_SYSTEM_BLOCK_NUMBER = "should_system_block_number"; + + /** @hide */ + public static final String METHOD_GET_BLOCK_SUPPRESSION_STATUS = + "get_block_suppression_status"; + + /** @hide */ + public static final String METHOD_SHOULD_SHOW_EMERGENCY_CALL_NOTIFICATION = + "should_show_emergency_call_notification"; + + /** @hide */ + public static final String METHOD_GET_ENHANCED_BLOCK_SETTING = "get_enhanced_block_setting"; + + /** @hide */ + public static final String METHOD_SET_ENHANCED_BLOCK_SETTING = "set_enhanced_block_setting"; + /** @hide */ public static final String RES_CAN_BLOCK_NUMBERS = "can_block"; @@ -406,26 +439,11 @@ public class BlockedNumberContract { public static final String ACTION_BLOCK_SUPPRESSION_STATE_CHANGED = "android.provider.action.BLOCK_SUPPRESSION_STATE_CHANGED"; - public static final String METHOD_NOTIFY_EMERGENCY_CONTACT = "notify_emergency_contact"; - - public static final String METHOD_END_BLOCK_SUPPRESSION = "end_block_suppression"; - - public static final String METHOD_SHOULD_SYSTEM_BLOCK_NUMBER = "should_system_block_number"; - - public static final String METHOD_GET_BLOCK_SUPPRESSION_STATUS = - "get_block_suppression_status"; - - public static final String METHOD_SHOULD_SHOW_EMERGENCY_CALL_NOTIFICATION = - "should_show_emergency_call_notification"; - public static final String RES_IS_BLOCKING_SUPPRESSED = "blocking_suppressed"; public static final String RES_BLOCKING_SUPPRESSED_UNTIL_TIMESTAMP = "blocking_suppressed_until_timestamp"; - public static final String METHOD_GET_ENHANCED_BLOCK_SETTING = "get_enhanced_block_setting"; - public static final String METHOD_SET_ENHANCED_BLOCK_SETTING = "set_enhanced_block_setting"; - /* Preference key of block numbers not in contacts setting. */ public static final String ENHANCED_SETTING_KEY_BLOCK_UNREGISTERED = "block_numbers_not_in_contacts_setting";