Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0b822c8 authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge changes from topic "expose-call-forward"

* changes:
  Move some of the call-forwarding related constants
  Expose and update the call forward/waiting APIs
parents 3a14c6bd 594dc4b9
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -10543,6 +10543,22 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
  }
  public final class CallForwardingInfo implements android.os.Parcelable {
    ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
    method public int describeContents();
    method @Nullable public String getNumber();
    method public int getReason();
    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 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
  }
  public final class CallQuality implements android.os.Parcelable {
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
@@ -11184,6 +11200,8 @@ package android.telephony {
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -11262,6 +11280,8 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
    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 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);
@@ -11300,6 +11320,10 @@ package android.telephony {
    field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
    field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
    field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
    field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
    field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
    field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
    field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
    field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
@@ -11356,6 +11380,15 @@ package android.telephony {
    field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
  }
  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 {
    ctor public UiccAccessRule(byte[], @Nullable String, long);
    method public int describeContents();
+33 −0
Original line number Diff line number Diff line
@@ -9425,6 +9425,22 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
  }
  public final class CallForwardingInfo implements android.os.Parcelable {
    ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
    method public int describeContents();
    method @Nullable public String getNumber();
    method public int getReason();
    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 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
  }
  public final class CallQuality implements android.os.Parcelable {
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
@@ -10066,6 +10082,8 @@ package android.telephony {
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -10144,6 +10162,8 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
    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 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);
@@ -10182,6 +10202,10 @@ package android.telephony {
    field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
    field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
    field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
    field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
    field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
    field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
    field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
    field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
@@ -10238,6 +10262,15 @@ package android.telephony {
    field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
  }
  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 {
    ctor public UiccAccessRule(byte[], @Nullable String, long);
    method public int describeContents();
+33 −0
Original line number Diff line number Diff line
@@ -27,6 +27,22 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
  }

  public final class CallForwardingInfo implements android.os.Parcelable {
    ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
    method public int describeContents();
    method @Nullable public String getNumber();
    method public int getReason();
    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 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
  }

  public final class CallQuality implements android.os.Parcelable {
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
@@ -640,6 +656,8 @@ package android.telephony {
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -719,6 +737,8 @@ 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 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 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);
@@ -756,6 +776,10 @@ package android.telephony {
    field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
    field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
    field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
    field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
    field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
    field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
    field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
    field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
@@ -812,6 +836,15 @@ package android.telephony {
    field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
  }

  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 {
    ctor public UiccAccessRule(byte[], @Nullable String, long);
    method public int describeContents();
+24 −85
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;

@@ -33,50 +34,14 @@ import java.util.Objects;
 * Defines the call forwarding information.
 * @hide
 */
@SystemApi
public final class CallForwardingInfo implements Parcelable {
    private static final String TAG = "CallForwardingInfo";

    /**
     * Indicates the call forwarding status is inactive.
     *
     * @hide
     */
    public static final int STATUS_INACTIVE = 0;

    /**
     * Indicates the call forwarding status is active.
     *
     * @hide
     */
    public static final int STATUS_ACTIVE = 1;

    /**
     * Indicates the call forwarding could not be enabled because the recipient is not on
     * Fixed Dialing Number (FDN) list.
     *
     * @hide
     */
    public static final int STATUS_FDN_CHECK_FAILURE = 2;

    /**
     * Indicates the call forwarding status is with an unknown error.
     *
     * @hide
     */
    public static final int STATUS_UNKNOWN_ERROR = 3;

    /**
     * Indicates the call forwarding is not supported (e.g. called via CDMA).
     *
     * @hide
     */
    public static final int STATUS_NOT_SUPPORTED = 4;

    /**
     * Indicates the call forwarding reason is "unconditional".
     * Indicates that call forwarding reason is "unconditional".
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
     *            and conditions +CCFC
     * @hide
     */
    public static final int REASON_UNCONDITIONAL = 0;

@@ -84,7 +49,6 @@ public final class CallForwardingInfo implements Parcelable {
     * Indicates the call forwarding status is "busy".
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
     *            and conditions +CCFC
     * @hide
     */
    public static final int REASON_BUSY = 1;

@@ -92,7 +56,6 @@ public final class CallForwardingInfo implements Parcelable {
     * Indicates the call forwarding reason is "no reply".
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
     *            and conditions +CCFC
     * @hide
     */
    public static final int REASON_NO_REPLY = 2;

@@ -100,7 +63,6 @@ public final class CallForwardingInfo implements Parcelable {
     * Indicates the call forwarding reason is "not reachable".
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
     *            and conditions +CCFC
     * @hide
     */
    public static final int REASON_NOT_REACHABLE = 3;

@@ -109,7 +71,6 @@ public final class CallForwardingInfo implements Parcelable {
     * simultaneously (unconditional, busy, no reply, and not reachable).
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
     *            and conditions +CCFC
     * @hide
     */
    public static final int REASON_ALL = 4;

@@ -118,26 +79,12 @@ public final class CallForwardingInfo implements Parcelable {
     * forwarding reasons simultaneously (busy, no reply, and not reachable).
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
     *            and conditions +CCFC
     * @hide
     */
    public static final int REASON_ALL_CONDITIONAL = 5;

    /**
     * Call forwarding function status
     */
    @IntDef(prefix = { "STATUS_" }, value = {
        STATUS_ACTIVE,
        STATUS_INACTIVE,
        STATUS_UNKNOWN_ERROR,
        STATUS_NOT_SUPPORTED,
        STATUS_FDN_CHECK_FAILURE
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface CallForwardingStatus {
    }

    /**
     * Call forwarding reason types
     * @hide
     */
    @IntDef(flag = true, prefix = { "REASON_" }, value = {
        REASON_UNCONDITIONAL,
@@ -152,9 +99,9 @@ public final class CallForwardingInfo implements Parcelable {
    }

    /**
     * The call forwarding status.
     * Whether call forwarding is enabled for this reason.
     */
    private int mStatus;
    private boolean mEnabled;

    /**
     * The call forwarding reason indicates the condition under which calls will be forwarded.
@@ -178,39 +125,35 @@ public final class CallForwardingInfo implements Parcelable {
    /**
     * Construct a CallForwardingInfo.
     *
     * @param status the call forwarding status
     * @param enabled Whether to enable call forwarding for the reason specified
     *                in {@link #getReason()}.
     * @param reason the call forwarding reason
     * @param number the phone number to which calls will be forwarded
     * @param timeSeconds the timeout (in seconds) before the forwarding is attempted
     * @hide
     */
    public CallForwardingInfo(@CallForwardingStatus int status, @CallForwardingReason int reason,
    public CallForwardingInfo(boolean enabled, @CallForwardingReason int reason,
            @Nullable String number, int timeSeconds) {
        mStatus = status;
        mEnabled = enabled;
        mReason = reason;
        mNumber = number;
        mTimeSeconds = timeSeconds;
    }

    /**
     * Returns the call forwarding status.
     * Whether call forwarding is enabled for the reason from {@link #getReason()}.
     *
     * @return the call forwarding status.
     *
     * @hide
     * @return {@code true} if enabled, {@code false} otherwise.
     */
    public @CallForwardingStatus int getStatus() {
        return mStatus;
    public boolean isEnabled() {
        return mEnabled;
    }

    /**
     * Returns the call forwarding reason. The call forwarding reason indicates the condition
     * under which calls will be forwarded. For example, {@link #REASON_NO_REPLY} indicates
     * that calls will be forward to {@link #getNumber()} when the user fails to answer the call.
     * that calls will be forwarded when the user fails to answer the call.
     *
     * @return the call forwarding reason.
     *
     * @hide
     */
    public @CallForwardingReason int getReason() {
        return mReason;
@@ -220,9 +163,7 @@ public final class CallForwardingInfo implements Parcelable {
     * Returns the phone number to which calls will be forwarded.
     *
     * @return the number calls will be forwarded to, or {@code null} if call forwarding
     * is being disabled.
     *
     * @hide
     *         is disabled.
     */
    @Nullable
    public String getNumber() {
@@ -230,16 +171,14 @@ public final class CallForwardingInfo implements Parcelable {
    }

    /**
     * Gets the timeout (in seconds) before the forwarding is attempted. For example,
     * Gets the timeout (in seconds) before forwarding is attempted. For example,
     * if {@link #REASON_NO_REPLY} is the call forwarding reason, the device will wait this
     * duration of time before forwarding the call to {@link #getNumber()}.
     * duration of time before forwarding the call to the number returned by {@link #getNumber()}.
     *
     * Reference: 3GPP TS 27.007 version 10.3.0 Release 10
     *            7.11 Call forwarding number and conditions +CCFC
     *
     * @return the timeout (in seconds) before the forwarding is attempted.
     *
     * @hide
     */
    @SuppressLint("MethodNameUnits")
    public int getTimeoutSeconds() {
@@ -257,14 +196,14 @@ public final class CallForwardingInfo implements Parcelable {
    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeString(mNumber);
        out.writeInt(mStatus);
        out.writeBoolean(mEnabled);
        out.writeInt(mReason);
        out.writeInt(mTimeSeconds);
    }

    private CallForwardingInfo(Parcel in) {
        mNumber = in.readString();
        mStatus = in.readInt();
        mEnabled = in.readBoolean();
        mReason = in.readInt();
        mTimeSeconds = in.readInt();
    }
@@ -281,7 +220,7 @@ public final class CallForwardingInfo implements Parcelable {
        }

        CallForwardingInfo other = (CallForwardingInfo) o;
        return mStatus == other.mStatus
        return mEnabled == other.mEnabled
                && mNumber == other.mNumber
                && mReason == other.mReason
                && mTimeSeconds == other.mTimeSeconds;
@@ -292,7 +231,7 @@ public final class CallForwardingInfo implements Parcelable {
     */
    @Override
    public int hashCode() {
        return Objects.hash(mStatus, mNumber, mReason, mTimeSeconds);
        return Objects.hash(mEnabled, mNumber, mReason, mTimeSeconds);
    }

    public static final @NonNull Parcelable.Creator<CallForwardingInfo> CREATOR =
@@ -313,7 +252,7 @@ public final class CallForwardingInfo implements Parcelable {
     */
    @Override
    public String toString() {
        return "[CallForwardingInfo: status=" + mStatus
        return "[CallForwardingInfo: enabled=" + mEnabled
                + ", reason= " + mReason
                + ", timeSec= " + mTimeSeconds + " seconds"
                + ", number=" + Rlog.pii(TAG, mNumber) + "]";
+224 −78

File changed.

Preview size limit exceeded, changes collapsed.

Loading