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

Commit 2c72a0d8 authored by Pranav Madapurmath's avatar Pranav Madapurmath Committed by Android (Google) Code Review
Browse files

Merge "Formalize DisconnectCause API" into main

parents 78bc5bff 4aaf2a23
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -13609,6 +13609,13 @@ package android.telecom {
    method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference);
  }
  public final class DisconnectCause implements android.os.Parcelable {
    ctor @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public DisconnectCause(int, @NonNull CharSequence, @NonNull CharSequence, @NonNull String, int, int, int, @Nullable android.telephony.ims.ImsReasonInfo);
    method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @Nullable public android.telephony.ims.ImsReasonInfo getImsReasonInfo();
    method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public int getTelephonyDisconnectCause();
    method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public int getTelephonyPreciseDisconnectCause();
  }
  public abstract class InCallService extends android.app.Service {
    method @Deprecated public android.telecom.Phone getPhone();
    method @Deprecated public void onPhoneCreated(android.telecom.Phone);
+27 −5
Original line number Diff line number Diff line
@@ -16,7 +16,10 @@

package android.telecom;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.media.ToneGenerator;
import android.os.Parcel;
import android.os.Parcelable;
@@ -25,6 +28,8 @@ import android.telephony.PreciseDisconnectCause;
import android.telephony.ims.ImsReasonInfo;
import android.text.TextUtils;

import com.android.server.telecom.flags.Flags;

import java.util.Objects;

/**
@@ -169,7 +174,9 @@ public final class DisconnectCause implements Parcelable {
    }

    /**
     * Creates a new DisconnectCause instance.
     * Creates a new DisconnectCause instance. This is used by Telephony to pass in extra debug
     * info to Telecom regarding the disconnect cause.
     *
     * @param code The code for the disconnect cause.
     * @param label The localized label to show to the user to explain the disconnect.
     * @param description The localized description to show to the user to explain the disconnect.
@@ -180,7 +187,10 @@ public final class DisconnectCause implements Parcelable {
     * @param imsReasonInfo The relevant {@link ImsReasonInfo}, or {@code null} if not available.
     * @hide
     */
    public DisconnectCause(int code, CharSequence label, CharSequence description, String reason,
    @SystemApi
    @FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
    public DisconnectCause(int code, @NonNull CharSequence label,
            @NonNull CharSequence description, @NonNull String reason,
            int toneToPlay, @Annotation.DisconnectCauses int telephonyDisconnectCause,
            @Annotation.PreciseDisconnectCauses int telephonyPreciseDisconnectCause,
            @Nullable ImsReasonInfo imsReasonInfo) {
@@ -241,28 +251,40 @@ public final class DisconnectCause implements Parcelable {
    }

    /**
     * Returns the telephony {@link android.telephony.DisconnectCause} for the call.
     * Returns the telephony {@link android.telephony.DisconnectCause} for the call. This is only
     * used internally by Telecom for providing extra debug information from Telephony.
     *
     * @return The disconnect cause.
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
    public @Annotation.DisconnectCauses int getTelephonyDisconnectCause() {
        return mTelephonyDisconnectCause;
    }

    /**
     * Returns the telephony {@link android.telephony.PreciseDisconnectCause} for the call.
     * Returns the telephony {@link android.telephony.PreciseDisconnectCause} for the call. This is
     * only used internally by Telecom for providing extra debug information from Telephony.
     *
     * @return The precise disconnect cause.
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
    public @Annotation.PreciseDisconnectCauses int getTelephonyPreciseDisconnectCause() {
        return mTelephonyPreciseDisconnectCause;
    }

    /**
     * Returns the telephony {@link ImsReasonInfo} associated with the call disconnection.
     * Returns the telephony {@link ImsReasonInfo} associated with the call disconnection. This is
     * only used internally by Telecom for providing extra debug information from Telephony.
     *
     * @return The {@link ImsReasonInfo} or {@code null} if not known.
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
    public @Nullable ImsReasonInfo getImsReasonInfo() {
        return mImsReasonInfo;
    }