diff --git a/core/api/current.txt b/core/api/current.txt index 1b519dc2c9e79..2a0f3aebfc5cf 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -5666,6 +5666,7 @@ package android.app { field public static final String EXTRA_AUDIO_CONTENTS_URI = "android.audioContents"; field public static final String EXTRA_BACKGROUND_IMAGE_URI = "android.backgroundImageUri"; 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_CHANNEL_GROUP_ID = "android.intent.extra.CHANNEL_GROUP_ID"; field public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID"; @@ -5972,6 +5973,7 @@ package android.app { method @NonNull public static android.app.Notification.CallStyle forScreeningCall(@NonNull android.app.Person, @NonNull android.app.PendingIntent, @NonNull android.app.PendingIntent); method @NonNull public android.app.Notification.CallStyle setAnswerButtonColorHint(@ColorInt int); method @NonNull public android.app.Notification.CallStyle setDeclineButtonColorHint(@ColorInt int); + 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); } diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index a60f1ca3cdcd8..f050eaa4aa075 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -1387,6 +1387,12 @@ public class Notification implements Parcelable */ public static final String EXTRA_CALL_TYPE = "android.callType"; + /** + * {@link #extras} key: whether the {@link android.app.Notification.CallStyle} notification + * is for a call that will activate video when answered. This extra is a boolean. + */ + public static final String EXTRA_CALL_IS_VIDEO = "android.callIsVideo"; + /** * {@link #extras} key: the person to be displayed as calling for the * {@link android.app.Notification.CallStyle} notification. This extra is a {@link Person}. @@ -9146,6 +9152,7 @@ public class Notification implements Parcelable private PendingIntent mAnswerIntent; private PendingIntent mDeclineIntent; private PendingIntent mHangUpIntent; + private boolean mIsVideo; private Integer mAnswerButtonColor; private Integer mDeclineButtonColor; private Icon mVerificationIcon; @@ -9237,6 +9244,16 @@ public class Notification implements Parcelable mHangUpIntent = hangUpIntent; } + /** + * Sets whether the call is a video call, which may affect the icons or text used on the + * required action buttons. + */ + @NonNull + public CallStyle setIsVideo(boolean isVideo) { + mIsVideo = isVideo; + return this; + } + /** * Optional icon to be displayed with {@link #setVerificationText(CharSequence) text} * as a verification status of the caller. @@ -9365,8 +9382,10 @@ public class Notification implements Parcelable @Nullable private Action makeAnswerAction() { - return mAnswerIntent == null ? null : makeAction(R.drawable.ic_call_answer, - R.string.call_notification_answer_action, + return mAnswerIntent == null ? null : makeAction( + mIsVideo ? R.drawable.ic_call_answer_video : R.drawable.ic_call_answer, + mIsVideo ? R.string.call_notification_answer_video_action + : R.string.call_notification_answer_action, mAnswerButtonColor, R.color.call_notification_answer_color, mAnswerIntent); } @@ -9545,6 +9564,7 @@ public class Notification implements Parcelable public void addExtras(Bundle extras) { super.addExtras(extras); extras.putInt(EXTRA_CALL_TYPE, mCallType); + extras.putBoolean(EXTRA_CALL_IS_VIDEO, mIsVideo); extras.putParcelable(EXTRA_CALL_PERSON, mPerson); if (mVerificationIcon != null) { extras.putParcelable(EXTRA_VERIFICATION_ICON, mVerificationIcon); @@ -9587,6 +9607,7 @@ public class Notification implements Parcelable protected void restoreFromExtras(Bundle extras) { super.restoreFromExtras(extras); mCallType = extras.getInt(EXTRA_CALL_TYPE); + mIsVideo = extras.getBoolean(EXTRA_CALL_IS_VIDEO); mPerson = extras.getParcelable(EXTRA_CALL_PERSON); mVerificationIcon = extras.getParcelable(EXTRA_VERIFICATION_ICON); mVerificationText = extras.getCharSequence(EXTRA_VERIFICATION_TEXT); diff --git a/core/res/res/drawable/ic_call_answer_video.xml b/core/res/res/drawable/ic_call_answer_video.xml new file mode 100644 index 0000000000000..77c889234dd0a --- /dev/null +++ b/core/res/res/drawable/ic_call_answer_video.xml @@ -0,0 +1,27 @@ + + + + \ No newline at end of file diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 3208dff1d9f69..8d07ae254ee1b 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -5151,6 +5151,8 @@ Answer + + Video Decline diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 3de2ac1080211..7506cf8624bf5 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3115,6 +3115,7 @@ + @@ -3124,6 +3125,7 @@ +