Merge "Add new API for new feature of display name." am: e43f70afc7

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1807961

Change-Id: I13c3cc86d2da47dff2fdd1f8caeec177eca1f1a0
This commit is contained in:
Grace Jia
2022-01-06 19:18:19 +00:00
committed by Automerger Merge Worker
9 changed files with 44 additions and 4 deletions

View File

@@ -33870,6 +33870,7 @@ package android.provider {
field public static final int PRESENTATION_ALLOWED = 1; // 0x1
field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
field public static final int PRESENTATION_UNAVAILABLE = 5; // 0x5
field public static final int PRESENTATION_UNKNOWN = 3; // 0x3
field public static final String PRIORITY = "priority";
field public static final int PRIORITY_NORMAL = 0; // 0x0
@@ -40594,6 +40595,7 @@ package android.telecom {
field public static final int PRESENTATION_ALLOWED = 1; // 0x1
field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
field public static final int PRESENTATION_UNAVAILABLE = 5; // 0x5
field public static final int PRESENTATION_UNKNOWN = 3; // 0x3
field public static final int PRIORITY_NORMAL = 0; // 0x0
field public static final int PRIORITY_URGENT = 1; // 0x1

View File

@@ -13095,6 +13095,7 @@ package android.telephony.ims {
field public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2; // 0x2
field public static final int OIR_PRESENTATION_PAYPHONE = 4; // 0x4
field public static final int OIR_PRESENTATION_RESTRICTED = 1; // 0x1
field public static final int OIR_PRESENTATION_UNAVAILABLE = 5; // 0x5
field public static final int OIR_PRESENTATION_UNKNOWN = 3; // 0x3
field public static final int PRIORITY_NORMAL = 0; // 0x0
field public static final int PRIORITY_URGENT = 1; // 0x1

View File

@@ -231,7 +231,7 @@ public class BlockedNumberContract {
prefix = { "STATUS_" },
value = {STATUS_NOT_BLOCKED, STATUS_BLOCKED_IN_LIST, STATUS_BLOCKED_RESTRICTED,
STATUS_BLOCKED_UNKNOWN_NUMBER, STATUS_BLOCKED_PAYPHONE,
STATUS_BLOCKED_NOT_IN_CONTACTS})
STATUS_BLOCKED_NOT_IN_CONTACTS, STATUS_BLOCKED_UNAVAILABLE})
public @interface BlockStatus {}
/**
@@ -276,6 +276,13 @@ public class BlockedNumberContract {
*/
public static final int STATUS_BLOCKED_NOT_IN_CONTACTS = 5;
/**
* Integer reason code used with {@link #RES_BLOCK_STATUS} to indicate that a call was blocked
* because it is from a number not available.
* @hide
*/
public static final int STATUS_BLOCKED_UNAVAILABLE = 6;
/**
* Integer reason indicating whether a call was blocked, and if so why.
* @hide
@@ -441,6 +448,9 @@ public class BlockedNumberContract {
/* Preference key for whether should show an emergency call notification. */
public static final String ENHANCED_SETTING_KEY_SHOW_EMERGENCY_CALL_NOTIFICATION =
"show_emergency_call_notification";
/* Preference key of block unavailable calls setting. */
public static final String ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE =
"block_unavailable_calls_setting";
/**
* Notifies the provider that emergency services were contacted by the user.
@@ -547,6 +557,7 @@ public class BlockedNumberContract {
* {@link #ENHANCED_SETTING_KEY_BLOCK_PRIVATE}
* {@link #ENHANCED_SETTING_KEY_BLOCK_PAYPHONE}
* {@link #ENHANCED_SETTING_KEY_BLOCK_UNKNOWN}
* {@link #ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE}
* {@link #ENHANCED_SETTING_KEY_EMERGENCY_CALL_NOTIFICATION_SHOWING}
* @return {@code true} if the setting is enabled. {@code false} otherwise.
*/
@@ -574,6 +585,7 @@ public class BlockedNumberContract {
* {@link #ENHANCED_SETTING_KEY_BLOCK_PRIVATE}
* {@link #ENHANCED_SETTING_KEY_BLOCK_PAYPHONE}
* {@link #ENHANCED_SETTING_KEY_BLOCK_UNKNOWN}
* {@link #ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE}
* {@link #ENHANCED_SETTING_KEY_EMERGENCY_CALL_NOTIFICATION_SHOWING}
* @param value the enabled statue of the setting to set.
*/
@@ -603,6 +615,8 @@ public class BlockedNumberContract {
return "blocked - payphone";
case STATUS_BLOCKED_NOT_IN_CONTACTS:
return "blocked - not in contacts";
case STATUS_BLOCKED_UNAVAILABLE:
return "blocked - unavailable";
}
return "unknown";
}

View File

@@ -910,6 +910,7 @@ public class CallLog {
* <li>{@link #PRESENTATION_RESTRICTED}</li>
* <li>{@link #PRESENTATION_UNKNOWN}</li>
* <li>{@link #PRESENTATION_PAYPHONE}</li>
* <li>{@link #PRESENTATION_UNAVAILABLE}</li>
* </ul>
* </p>
*
@@ -925,6 +926,8 @@ public class CallLog {
public static final int PRESENTATION_UNKNOWN = 3;
/** Number is a pay phone. */
public static final int PRESENTATION_PAYPHONE = 4;
/** Number is unavailable. */
public static final int PRESENTATION_UNAVAILABLE = 5;
/**
* The ISO 3166-1 two letters country code of the country where the
@@ -2028,6 +2031,10 @@ public class CallLog {
return presentation;
}
if (presentation == TelecomManager.PRESENTATION_UNAVAILABLE) {
return PRESENTATION_UNAVAILABLE;
}
if (TextUtils.isEmpty(number)
|| presentation == TelecomManager.PRESENTATION_UNKNOWN) {
return PRESENTATION_UNKNOWN;

View File

@@ -632,8 +632,9 @@ public abstract class CallScreeningService extends Service {
* post-dial digits are passed.
* <p>
* Calls with a {@link Call.Details#getHandlePresentation()} of
* {@link TelecomManager#PRESENTATION_RESTRICTED}, {@link TelecomManager#PRESENTATION_UNKNOWN}
* or {@link TelecomManager#PRESENTATION_PAYPHONE} presentation are not provided to the
* {@link TelecomManager#PRESENTATION_RESTRICTED}, {@link TelecomManager#PRESENTATION_UNKNOWN},
* {@link TelecomManager#PRESENTATION_UNAVAILABLE} or
* {@link TelecomManager#PRESENTATION_PAYPHONE} presentation are not provided to the
* {@link CallScreeningService}.
*
* @param callDetails Information about a new call, see {@link Call.Details}.

View File

@@ -987,6 +987,11 @@ public class TelecomManager {
*/
public static final int PRESENTATION_PAYPHONE = 4;
/**
* Indicates that the address or number of a call is unavailable.
*/
public static final int PRESENTATION_UNAVAILABLE = 5;
/*
* Values for the adb property "persist.radio.videocall.audio.output"
@@ -1003,7 +1008,7 @@ public class TelecomManager {
@IntDef(
prefix = { "PRESENTATION_" },
value = {PRESENTATION_ALLOWED, PRESENTATION_RESTRICTED, PRESENTATION_UNKNOWN,
PRESENTATION_PAYPHONE})
PRESENTATION_PAYPHONE, PRESENTATION_UNAVAILABLE})
public @interface Presentation {}

View File

@@ -2248,6 +2248,7 @@ public class CarrierConfigManager {
* android.provider.BlockedNumberContract.SystemContract#ENHANCED_SETTING_KEY_BLOCK_PRIVATE
* android.provider.BlockedNumberContract.SystemContract#ENHANCED_SETTING_KEY_BLOCK_PAYPHONE
* android.provider.BlockedNumberContract.SystemContract#ENHANCED_SETTING_KEY_BLOCK_UNKNOWN
* android.provider.BlockedNumberContract.SystemContract#ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE
*
* <p>
* 1. For Single SIM(SS) device, it can be customized in both carrier_config_mccmnc.xml

View File

@@ -317,6 +317,10 @@ public final class ImsCallProfile implements Parcelable {
* Payphone presentation for Originating Identity.
*/
public static final int OIR_PRESENTATION_PAYPHONE = 4;
/**
* Unavailable presentation for Originating Identity.
*/
public static final int OIR_PRESENTATION_UNAVAILABLE = 5;
//Values for EXTRA_DIALSTRING
/**
@@ -989,6 +993,8 @@ public final class ImsCallProfile implements Parcelable {
return ImsCallProfile.OIR_PRESENTATION_PAYPHONE;
case PhoneConstants.PRESENTATION_UNKNOWN:
return ImsCallProfile.OIR_PRESENTATION_UNKNOWN;
case PhoneConstants.PRESENTATION_UNAVAILABLE:
return ImsCallProfile.OIR_PRESENTATION_UNAVAILABLE;
default:
return ImsCallProfile.OIR_DEFAULT;
}
@@ -1017,6 +1023,8 @@ public final class ImsCallProfile implements Parcelable {
return PhoneConstants.PRESENTATION_ALLOWED;
case ImsCallProfile.OIR_PRESENTATION_PAYPHONE:
return PhoneConstants.PRESENTATION_PAYPHONE;
case ImsCallProfile.OIR_PRESENTATION_UNAVAILABLE:
return PhoneConstants.PRESENTATION_UNAVAILABLE;
case ImsCallProfile.OIR_PRESENTATION_UNKNOWN:
return PhoneConstants.PRESENTATION_UNKNOWN;
default:

View File

@@ -95,6 +95,7 @@ public class PhoneConstants {
public static final int PRESENTATION_UNKNOWN = 3; // no specified or unknown by network
@UnsupportedAppUsage
public static final int PRESENTATION_PAYPHONE = 4; // show pay phone info
public static final int PRESENTATION_UNAVAILABLE = 5; // show unavailable
public static final String PHONE_NAME_KEY = "phoneName";
public static final String DATA_NETWORK_TYPE_KEY = "networkType";