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

Commit 4aaf2a23 authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Formalize DisconnectCause API

As part of telecom mainline, formalize the hidden DisconnectCause
constructor (used by Telephony) into a system API. Additionally, the
telephony related debug info getters also need to be formalized:
getTelephonyDisconnectCause, getTelephonyPreciseDisconnectCause,
getImsReasonInfo.

Bug: 322518612
Bug: 311773409
Test: atest DataObjectUnitTests
Change-Id: Idb0c502bde5391012349a58358515c59fc3cb893
parent 6892184b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -13602,6 +13602,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;
    }