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

Commit e672bbf7 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Unhide CallStyle call type

Test: cts NotificationTest
Bug: 242995647
Change-Id: I4a83cb340b4f1a09a6744c628814b1600244cbb1
parent 4d6fd1df
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5933,6 +5933,7 @@ package android.app {
    field public static final String EXTRA_BIG_TEXT = "android.bigText";
    field public static final String EXTRA_CALL_IS_VIDEO = "android.callIsVideo";
    field public static final String EXTRA_CALL_PERSON = "android.callPerson";
    field public static final String EXTRA_CALL_TYPE = "android.callType";
    field public static final String EXTRA_CHANNEL_GROUP_ID = "android.intent.extra.CHANNEL_GROUP_ID";
    field public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID";
    field public static final String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown";
@@ -6240,6 +6241,10 @@ package android.app {
    method @NonNull public android.app.Notification.CallStyle setIsVideo(boolean);
    method @NonNull public android.app.Notification.CallStyle setVerificationIcon(@Nullable android.graphics.drawable.Icon);
    method @NonNull public android.app.Notification.CallStyle setVerificationText(@Nullable CharSequence);
    field public static final int CALL_TYPE_INCOMING = 1; // 0x1
    field public static final int CALL_TYPE_ONGOING = 2; // 0x2
    field public static final int CALL_TYPE_SCREENING = 3; // 0x3
    field public static final int CALL_TYPE_UNKNOWN = 0; // 0x0
  }
  public static final class Notification.CarExtender implements android.app.Notification.Extender {
+37 −5
Original line number Diff line number Diff line
@@ -1421,7 +1421,6 @@ public class Notification implements Parcelable
    /**
     * {@link #extras} key: the type of call represented by the
     * {@link android.app.Notification.CallStyle} notification. This extra is an int.
     * @hide
     */
    public static final String EXTRA_CALL_TYPE = "android.callType";
@@ -9301,11 +9300,43 @@ public class Notification implements Parcelable
     * </pre>
     */
    public static class CallStyle extends Style {
        /** @hide */
        /**
         * @hide
         */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef({
                CALL_TYPE_UNKNOWN,
                CALL_TYPE_INCOMING,
                CALL_TYPE_ONGOING,
                CALL_TYPE_SCREENING
        })
        public @interface CallType {};
        /**
         * Unknown call type.
         *
         * See {@link #EXTRA_CALL_TYPE}.
         */
        public static final int CALL_TYPE_UNKNOWN = 0;
        /**
         *  Call type for incoming calls.
         *
         *  See {@link #EXTRA_CALL_TYPE}.
         */
        public static final int CALL_TYPE_INCOMING = 1;
        /** @hide */
        /**
         * Call type for ongoing calls.
         *
         * See {@link #EXTRA_CALL_TYPE}.
         */
        public static final int CALL_TYPE_ONGOING = 2;
        /** @hide */
        /**
         * Call type for calls that are being screened.
         *
         * See {@link #EXTRA_CALL_TYPE}.
         */
        public static final int CALL_TYPE_SCREENING = 3;
        /**
@@ -9392,13 +9423,14 @@ public class Notification implements Parcelable
        }
        /**
         * @param callType The type of the call
         * @param person The person displayed for the incoming call.
         *             The user also needs to have a non-empty name associated with it.
         * @param hangUpIntent The intent to be sent when the user taps the hang up action
         * @param declineIntent The intent to be sent when the user taps the decline action
         * @param answerIntent The intent to be sent when the user taps the answer action
         */
        private CallStyle(int callType, @NonNull Person person,
        private CallStyle(@CallType int callType, @NonNull Person person,
                @Nullable PendingIntent hangUpIntent, @Nullable PendingIntent declineIntent,
                @Nullable PendingIntent answerIntent) {
            if (person == null || TextUtils.isEmpty(person.getName())) {