Merge changes from topic "expose-call-forward" am: f0b822c8bb

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

Change-Id: I12392eee398fef6be867a10cf6d627a1c4b3eea8
This commit is contained in:
Hall Liu
2020-10-22 21:26:05 +00:00
committed by Automerger Merge Worker
5 changed files with 56 additions and 55 deletions

View File

@@ -10551,16 +10551,12 @@ package android.telephony {
method public int getTimeoutSeconds();
method public boolean isEnabled();
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
field public static final int ERROR_FDN_CHECK_FAILURE = 2; // 0x2
field public static final int ERROR_NOT_SUPPORTED = 3; // 0x3
field public static final int ERROR_UNKNOWN = 1; // 0x1
field public static final int REASON_ALL = 4; // 0x4
field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
field public static final int REASON_BUSY = 1; // 0x1
field public static final int REASON_NOT_REACHABLE = 3; // 0x3
field public static final int REASON_NO_REPLY = 2; // 0x2
field public static final int REASON_UNCONDITIONAL = 0; // 0x0
field public static final int SUCCESS = 0; // 0x0
}
public final class CallQuality implements android.os.Parcelable {
@@ -11285,7 +11281,7 @@ package android.telephony {
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingStatus(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
@@ -11387,6 +11383,10 @@ package android.telephony {
public static interface TelephonyManager.CallForwardingInfoCallback {
method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
method public void onError(int);
field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
public final class UiccAccessRule implements android.os.Parcelable {

View File

@@ -9433,16 +9433,12 @@ package android.telephony {
method public int getTimeoutSeconds();
method public boolean isEnabled();
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
field public static final int ERROR_FDN_CHECK_FAILURE = 2; // 0x2
field public static final int ERROR_NOT_SUPPORTED = 3; // 0x3
field public static final int ERROR_UNKNOWN = 1; // 0x1
field public static final int REASON_ALL = 4; // 0x4
field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
field public static final int REASON_BUSY = 1; // 0x1
field public static final int REASON_NOT_REACHABLE = 3; // 0x3
field public static final int REASON_NO_REPLY = 2; // 0x2
field public static final int REASON_UNCONDITIONAL = 0; // 0x0
field public static final int SUCCESS = 0; // 0x0
}
public final class CallQuality implements android.os.Parcelable {
@@ -10167,7 +10163,7 @@ package android.telephony {
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingStatus(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
@@ -10269,6 +10265,10 @@ package android.telephony {
public static interface TelephonyManager.CallForwardingInfoCallback {
method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
method public void onError(int);
field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
public final class UiccAccessRule implements android.os.Parcelable {

View File

@@ -35,16 +35,12 @@ package android.telephony {
method public int getTimeoutSeconds();
method public boolean isEnabled();
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
field public static final int ERROR_FDN_CHECK_FAILURE = 2; // 0x2
field public static final int ERROR_NOT_SUPPORTED = 3; // 0x3
field public static final int ERROR_UNKNOWN = 1; // 0x1
field public static final int REASON_ALL = 4; // 0x4
field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
field public static final int REASON_BUSY = 1; // 0x1
field public static final int REASON_NOT_REACHABLE = 3; // 0x3
field public static final int REASON_NO_REPLY = 2; // 0x2
field public static final int REASON_UNCONDITIONAL = 0; // 0x0
field public static final int SUCCESS = 0; // 0x0
}
public final class CallQuality implements android.os.Parcelable {
@@ -742,7 +738,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingStatus(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
@@ -843,6 +839,10 @@ package android.telephony {
public static interface TelephonyManager.CallForwardingInfoCallback {
method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
method public void onError(int);
field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
public final class UiccAccessRule implements android.os.Parcelable {

View File

@@ -38,27 +38,6 @@ import java.util.Objects;
public final class CallForwardingInfo implements Parcelable {
private static final String TAG = "CallForwardingInfo";
/**
* Indicates that the operation was successful.
*/
public static final int SUCCESS = 0;
/**
* Indicates that setting or retrieving the call forwarding info failed with an unknown error.
*/
public static final int ERROR_UNKNOWN = 1;
/**
* Indicates that call forwarding is not enabled because the recipient is not on a
* Fixed Dialing Number (FDN) list.
*/
public static final int ERROR_FDN_CHECK_FAILURE = 2;
/**
* Indicates that call forwarding is not supported on the network at this time.
*/
public static final int ERROR_NOT_SUPPORTED = 3;
/**
* Indicates that call forwarding reason is "unconditional".
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
@@ -103,19 +82,6 @@ public final class CallForwardingInfo implements Parcelable {
*/
public static final int REASON_ALL_CONDITIONAL = 5;
/**
* Call forwarding errors
* @hide
*/
@IntDef(prefix = { "ERROR_" }, value = {
ERROR_UNKNOWN,
ERROR_NOT_SUPPORTED,
ERROR_FDN_CHECK_FAILURE
})
@Retention(RetentionPolicy.SOURCE)
public @interface CallForwardingError{
}
/**
* Call forwarding reason types
* @hide

View File

@@ -12753,6 +12753,40 @@ public class TelephonyManager {
*/
@SystemApi
public interface CallForwardingInfoCallback {
/**
* Indicates that the operation was successful.
*/
int RESULT_SUCCESS = 0;
/**
* Indicates that setting or retrieving the call forwarding info failed with an unknown
* error.
*/
int RESULT_ERROR_UNKNOWN = 1;
/**
* Indicates that call forwarding is not enabled because the recipient is not on a
* Fixed Dialing Number (FDN) list.
*/
int RESULT_ERROR_FDN_CHECK_FAILURE = 2;
/**
* Indicates that call forwarding is not supported on the network at this time.
*/
int RESULT_ERROR_NOT_SUPPORTED = 3;
/**
* Call forwarding errors
* @hide
*/
@IntDef(prefix = { "RESULT_ERROR_" }, value = {
RESULT_ERROR_UNKNOWN,
RESULT_ERROR_NOT_SUPPORTED,
RESULT_ERROR_FDN_CHECK_FAILURE
})
@Retention(RetentionPolicy.SOURCE)
@interface CallForwardingError{
}
/**
* Called when the call forwarding info is successfully retrieved from the network.
* @param info information about how calls are forwarded
@@ -12763,7 +12797,7 @@ public class TelephonyManager {
* Called when there was an error retrieving the call forwarding information.
* @param error
*/
void onError(@CallForwardingInfo.CallForwardingError int error);
void onError(@CallForwardingError int error);
}
/**
@@ -12836,9 +12870,9 @@ public class TelephonyManager {
* @param executor The executor on which the listener will be called. Must be non-null if
* {@code listener} is non-null.
* @param resultListener Asynchronous listener that'll be called when the operation completes.
* Called with {@link CallForwardingInfo#SUCCESS} if the operation
* succeeded and an error code from {@link CallForwardingInfo}
* if it failed.
* Called with {@link CallForwardingInfoCallback#RESULT_SUCCESS} if the
* operation succeeded and an error code from
* {@link CallForwardingInfoCallback} it failed.
*
* @throws IllegalArgumentException if any of the following are true for the parameter
* callForwardingInfo:
@@ -12864,7 +12898,8 @@ public class TelephonyManager {
@SystemApi
public void setCallForwarding(@NonNull CallForwardingInfo callForwardingInfo,
@Nullable @CallbackExecutor Executor executor,
@Nullable @CallForwardingInfo.CallForwardingError Consumer<Integer> resultListener) {
@Nullable @CallForwardingInfoCallback.CallForwardingError
Consumer<Integer> resultListener) {
if (callForwardingInfo == null) {
throw new IllegalArgumentException("callForwardingInfo is null");
}
@@ -13020,7 +13055,7 @@ public class TelephonyManager {
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setCallWaitingStatus(boolean enabled, @Nullable Executor executor,
public void setCallWaitingEnabled(boolean enabled, @Nullable Executor executor,
@Nullable Consumer<Integer> resultListener) {
if (resultListener != null) {
Objects.requireNonNull(executor);