From eb1698b1d3aae1f03a441b083d003ee061133d9b Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 18 Mar 2021 16:31:44 -0400 Subject: [PATCH] Be more specific about media statuses Test: atest ConversationStatusTest Fixes: 183130972 Change-Id: I0d05619bface3ff633c3bf4c02f8b7bf01876fe8 --- core/api/current.txt | 9 ++-- .../app/people/ConversationStatus.java | 44 ++++++++++++++++--- .../systemui/people/PeopleSpaceUtils.java | 7 ++- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 08d82f4a0dfe6..4f908d472e900 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -8003,13 +8003,14 @@ package android.app.people { method public long getStartTimeMillis(); method public void writeToParcel(@NonNull android.os.Parcel, int); field public static final int ACTIVITY_ANNIVERSARY = 2; // 0x2 + field public static final int ACTIVITY_AUDIO = 4; // 0x4 field public static final int ACTIVITY_BIRTHDAY = 1; // 0x1 - field public static final int ACTIVITY_GAME = 5; // 0x5 - field public static final int ACTIVITY_LOCATION = 6; // 0x6 - field public static final int ACTIVITY_MEDIA = 4; // 0x4 + field public static final int ACTIVITY_GAME = 6; // 0x6 + field public static final int ACTIVITY_LOCATION = 7; // 0x7 field public static final int ACTIVITY_NEW_STORY = 3; // 0x3 field public static final int ACTIVITY_OTHER = 0; // 0x0 - field public static final int ACTIVITY_UPCOMING_BIRTHDAY = 7; // 0x7 + field public static final int ACTIVITY_UPCOMING_BIRTHDAY = 8; // 0x8 + field public static final int ACTIVITY_VIDEO = 5; // 0x5 field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0 field public static final int AVAILABILITY_BUSY = 1; // 0x1 field public static final int AVAILABILITY_OFFLINE = 2; // 0x2 diff --git a/core/java/android/app/people/ConversationStatus.java b/core/java/android/app/people/ConversationStatus.java index d2a0255d572ed..d351683386e23 100644 --- a/core/java/android/app/people/ConversationStatus.java +++ b/core/java/android/app/people/ConversationStatus.java @@ -36,7 +36,8 @@ public final class ConversationStatus implements Parcelable { ACTIVITY_BIRTHDAY, ACTIVITY_ANNIVERSARY, ACTIVITY_NEW_STORY, - ACTIVITY_MEDIA, + ACTIVITY_AUDIO, + ACTIVITY_VIDEO, ACTIVITY_GAME, ACTIVITY_LOCATION, ACTIVITY_UPCOMING_BIRTHDAY @@ -44,14 +45,47 @@ public final class ConversationStatus implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface ActivityType {} + /** + * Constant representing that the conversation user is engaged in an activity that cannot be + * more specifically represented by another type. + */ public static final int ACTIVITY_OTHER = 0; + /** + * Constant representing that today is the conversation user's birthday. + */ public static final int ACTIVITY_BIRTHDAY = 1; + /** + * Constant representing that the conversation user and the device user are celebrating + * and anniversary today. + */ public static final int ACTIVITY_ANNIVERSARY = 2; + /** + * Constant representing that the conversation user has posted a new story. + */ public static final int ACTIVITY_NEW_STORY = 3; - public static final int ACTIVITY_MEDIA = 4; - public static final int ACTIVITY_GAME = 5; - public static final int ACTIVITY_LOCATION = 6; - public static final int ACTIVITY_UPCOMING_BIRTHDAY = 7; + /** + * Constant representing that the conversation user is listening to music or other audio + * like a podcast. + */ + public static final int ACTIVITY_AUDIO = 4; + /** + * Constant representing that the conversation user is watching video content. + */ + public static final int ACTIVITY_VIDEO = 5; + /** + * Constant representing that the conversation user is playing a game. + */ + public static final int ACTIVITY_GAME = 6; + /** + * Constant representing that the conversation user is sharing status with the device user. + * Use this to represent a general 'this person is sharing their location with you' status or + * a more specific 'this is the current location of this person' status. + */ + public static final int ACTIVITY_LOCATION = 7; + /** + * Constant representing that the conversation user's birthday is approaching soon. + */ + public static final int ACTIVITY_UPCOMING_BIRTHDAY = 8; /** @hide */ @IntDef(prefix = { "AVAILABILITY_" }, value = { diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java index aa45178b64390..94580129b9c5e 100644 --- a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java +++ b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java @@ -19,12 +19,13 @@ package com.android.systemui.people; import static android.app.Notification.CATEGORY_MISSED_CALL; import static android.app.Notification.EXTRA_MESSAGES; import static android.app.people.ConversationStatus.ACTIVITY_ANNIVERSARY; +import static android.app.people.ConversationStatus.ACTIVITY_AUDIO; import static android.app.people.ConversationStatus.ACTIVITY_BIRTHDAY; import static android.app.people.ConversationStatus.ACTIVITY_GAME; import static android.app.people.ConversationStatus.ACTIVITY_LOCATION; -import static android.app.people.ConversationStatus.ACTIVITY_MEDIA; import static android.app.people.ConversationStatus.ACTIVITY_NEW_STORY; import static android.app.people.ConversationStatus.ACTIVITY_UPCOMING_BIRTHDAY; +import static android.app.people.ConversationStatus.ACTIVITY_VIDEO; import static android.app.people.ConversationStatus.AVAILABILITY_AVAILABLE; import android.annotation.Nullable; @@ -509,8 +510,10 @@ public class PeopleSpaceUtils { return context.getString(R.string.location_status); case ACTIVITY_NEW_STORY: return context.getString(R.string.new_story_status); - case ACTIVITY_MEDIA: + case ACTIVITY_VIDEO: return context.getString(R.string.video_status); + case ACTIVITY_AUDIO: + return context.getString(R.string.audio_status); case ACTIVITY_GAME: return context.getString(R.string.game_status); default: