public static class BlockedNumberContract.SystemContract extends Object
The contract between the blockednumber provider and the system.
This is a wrapper over BlockedNumberContract
that also manages the blocking
behavior when the user contacts emergency services. See
notifyEmergencyContact(Context)
for details. All methods are protected by
android.Manifest.permission#READ_BLOCKED_NUMBERS
and
android.Manifest.permission#WRITE_BLOCKED_NUMBERS
appropriately which ensure that
only system can access the methods defined here.
Modifier and Type | Class and Description |
---|---|
static class |
BlockedNumberContract.SystemContract.BlockSuppressionStatus
Represents the current status of
shouldSystemBlockNumber(Context, String) . |
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_BLOCK_SUPPRESSION_STATE_CHANGED
A protected broadcast intent action for letting components with
android.Manifest.permission#READ_BLOCKED_NUMBERS know that the block suppression
status as returned by getBlockSuppressionStatus(Context) has been updated. |
static String |
METHOD_END_BLOCK_SUPPRESSION |
static String |
METHOD_GET_BLOCK_SUPPRESSION_STATUS |
static String |
METHOD_NOTIFY_EMERGENCY_CONTACT |
static String |
METHOD_SHOULD_SYSTEM_BLOCK_NUMBER |
static String |
RES_BLOCKING_SUPPRESSED_UNTIL_TIMESTAMP |
static String |
RES_IS_BLOCKING_SUPPRESSED |
Constructor and Description |
---|
SystemContract() |
Modifier and Type | Method and Description |
---|---|
static void |
endBlockSuppression(Context context)
Notifies the provider to disable suppressing blocking.
|
static BlockedNumberContract.SystemContract.BlockSuppressionStatus |
getBlockSuppressionStatus(Context context)
Returns the current status of block suppression.
|
static void |
notifyEmergencyContact(Context context)
Notifies the provider that emergency services were contacted by the user.
|
static boolean |
shouldSystemBlockNumber(Context context,
String phoneNumber)
|
public static final String ACTION_BLOCK_SUPPRESSION_STATE_CHANGED
android.Manifest.permission#READ_BLOCKED_NUMBERS
know that the block suppression
status as returned by getBlockSuppressionStatus(Context)
has been updated.public static final String METHOD_NOTIFY_EMERGENCY_CONTACT
public static final String METHOD_END_BLOCK_SUPPRESSION
public static final String METHOD_SHOULD_SYSTEM_BLOCK_NUMBER
public static final String METHOD_GET_BLOCK_SUPPRESSION_STATUS
public static final String RES_IS_BLOCKING_SUPPRESSED
public static final String RES_BLOCKING_SUPPRESSED_UNTIL_TIMESTAMP
public static void notifyEmergencyContact(Context context)
This results in shouldSystemBlockNumber(android.content.Context, java.lang.String)
returning false
independent
of the contents of the provider for a duration defined by
CarrierConfigManager.KEY_DURATION_BLOCKING_DISABLED_AFTER_EMERGENCY_INT
the provider unless endBlockSuppression(Context)
is called.
public static void endBlockSuppression(Context context)
public static boolean shouldSystemBlockNumber(Context context, String phoneNumber)
true
if phoneNumber
is blocked taking
notifyEmergencyContact(Context)
into consideration. If emergency services have
not been contacted recently, this method is equivalent to
BlockedNumberContract.isBlocked(Context, String)
.public static BlockedNumberContract.SystemContract.BlockSuppressionStatus getBlockSuppressionStatus(Context context)