diff options
| author | Charles Chen <charlesccchen@google.com> | 2022-09-14 01:00:04 +0800 |
|---|---|---|
| committer | Charles Chen <charlesccchen@google.com> | 2022-09-21 08:33:47 +0000 |
| commit | 6012e9b7489bc3ef38c54841e3a7dc77076d6f2b (patch) | |
| tree | 514ca4d56eb192f08a915e11098a0aa890c7e8b7 /core/java | |
| parent | a13ffe82ffe7920defbb3b2290c0f3cfd3f3eb31 (diff) | |
Send TaskFragmentParentInfo for visibility changes
This CL propagates visibility from Activity to Task, and dispatch
#onTaskFragmentParentInfoChanged is there's a task visiblity
update. This CL also send the callback when the associated Display
of Task changes.
Test: atest TaskFragmentOrganizerControllerTest
fixes: 243609832
Change-Id: I3b0198cfd11a3ec4917f92d0a1e540cf16827d08
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/window/TaskFragmentParentInfo.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/window/TaskFragmentParentInfo.java b/core/java/android/window/TaskFragmentParentInfo.java index c89a54e90f58..64b2638407df 100644 --- a/core/java/android/window/TaskFragmentParentInfo.java +++ b/core/java/android/window/TaskFragmentParentInfo.java @@ -97,6 +97,34 @@ public class TaskFragmentParentInfo implements Parcelable { + "}"; } + /** + * Indicates that whether this {@link TaskFragmentParentInfo} equals to {@code obj}. + * Note that {@link #equalsForTaskFragmentOrganizer(TaskFragmentParentInfo)} should be used + * for most cases because not all {@link Configuration} properties are interested for + * {@link TaskFragmentOrganizer}. + */ + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof TaskFragmentParentInfo)) { + return false; + } + final TaskFragmentParentInfo that = (TaskFragmentParentInfo) obj; + return mConfiguration.equals(that.mConfiguration) + && mDisplayId == that.mDisplayId + && mVisibleRequested == that.mVisibleRequested; + } + + @Override + public int hashCode() { + int result = mConfiguration.hashCode(); + result = 31 * result + mDisplayId; + result = 31 * result + (mVisibleRequested ? 1 : 0); + return result; + } + @Override public void writeToParcel(@NonNull Parcel dest, int flags) { mConfiguration.writeToParcel(dest, flags); |
