diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-08-03 23:19:26 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-08-03 23:19:26 +0000 |
commit | 71177178404bab0b23d1aedecac30a2f1f7fa913 (patch) | |
tree | e487bccaa5b0c8bc9c98e1d6813d3ac4e6de414f | |
parent | 2c7d4133cbabcd7544ff2b49957107e35f720438 (diff) | |
parent | b86b71823f1388ae80f54c6a6d3da2ab0c8c2ac1 (diff) | |
download | base-71177178404bab0b23d1aedecac30a2f1f7fa913.tar.gz |
Snap for 8903759 from b86b71823f1388ae80f54c6a6d3da2ab0c8c2ac1 to tm-d1-release
Change-Id: Iff83722cb76a68ed9013c5b2b850942887448af1
7 files changed, 119 insertions, 1 deletions
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index d6441a2b629b..4e426720ab03 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -1442,6 +1442,11 @@ public class ActivityOptions extends ComponentOptions { } /** @hide */ + public void setRemoteTransition(@Nullable RemoteTransition remoteTransition) { + mRemoteTransition = remoteTransition; + } + + /** @hide */ public static ActivityOptions fromBundle(Bundle bOptions) { return bOptions != null ? new ActivityOptions(bOptions) : null; } diff --git a/core/proto/android/server/windowmanagerservice.proto b/core/proto/android/server/windowmanagerservice.proto index 152d729da3b6..92ac389ece67 100644 --- a/core/proto/android/server/windowmanagerservice.proto +++ b/core/proto/android/server/windowmanagerservice.proto @@ -116,6 +116,7 @@ message KeyguardControllerProto { repeated KeyguardOccludedProto keyguard_occluded_states = 2 [deprecated=true]; optional bool aod_showing = 3; repeated KeyguardPerDisplayProto keyguard_per_display = 4; + optional bool keyguard_going_away = 5; } message KeyguardOccludedProto { @@ -132,6 +133,7 @@ message KeyguardPerDisplayProto { optional bool keyguard_showing = 2; optional bool aod_showing = 3; optional bool keyguard_occluded = 4; + optional bool keyguard_going_away = 5; } /* represents PhoneWindowManager */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java index a552f999aeb4..a76f0827fc18 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java @@ -1312,6 +1312,7 @@ public class NotificationChildrenContainer extends ViewGroup } float bottomRoundness = last ? currentBottomRoundness : 0.0f; child.setBottomRoundness(bottomRoundness, isShown() /* animate */); + child.setTopRoundness(0.0f, false /* animate */); last = false; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java index 597c949168d4..cf1edf9094df 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java @@ -483,6 +483,10 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue int state = mAnimationScheduler.getAnimationState(); if (state == IDLE || state == SHOWING_PERSISTENT_DOT) { animateShow(mSystemIconArea, animate); + } else { + // We are in the middle of a system status event animation, which will animate the + // alpha (but not the visibility). Allow the view to become visible again + mSystemIconArea.setVisibility(View.VISIBLE); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java index 6abc687f0ebb..034e06d7e8c4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java @@ -16,6 +16,11 @@ package com.android.systemui.statusbar.phone.fragment; import static android.view.Display.DEFAULT_DISPLAY; +import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_IN; +import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_OUT; +import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.IDLE; +import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.RUNNING_CHIP_ANIM; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -25,6 +30,7 @@ import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import android.animation.Animator; import android.app.Fragment; import android.app.StatusBarManager; import android.content.Context; @@ -127,7 +133,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest { } @Test - public void testDisableSystemInfo() { + public void testDisableSystemInfo_systemAnimationIdle_doesHide() { + when(mAnimationScheduler.getAnimationState()).thenReturn(IDLE); CollapsedStatusBarFragment fragment = resumeAndGetFragment(); fragment.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_SYSTEM_INFO, 0, false); @@ -140,6 +147,98 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest { } @Test + public void testSystemStatusAnimation_startedDisabled_finishedWithAnimator_showsSystemInfo() { + // GIVEN the status bar hides the system info via disable flags, while there is no event + CollapsedStatusBarFragment fragment = resumeAndGetFragment(); + when(mAnimationScheduler.getAnimationState()).thenReturn(IDLE); + fragment.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_SYSTEM_INFO, 0, false); + assertEquals(View.INVISIBLE, getSystemIconAreaView().getVisibility()); + + // WHEN the disable flags are cleared during a system event animation + when(mAnimationScheduler.getAnimationState()).thenReturn(RUNNING_CHIP_ANIM); + fragment.disable(DEFAULT_DISPLAY, 0, 0, false); + + // THEN the view is made visible again, but still low alpha + assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility()); + assertEquals(0, getSystemIconAreaView().getAlpha(), 0.01); + + // WHEN the system event animation finishes + when(mAnimationScheduler.getAnimationState()).thenReturn(ANIMATING_OUT); + Animator anim = fragment.onSystemEventAnimationFinish(false); + anim.start(); + processAllMessages(); + anim.end(); + + // THEN the system info is full alpha + assertEquals(1, getSystemIconAreaView().getAlpha(), 0.01); + } + + @Test + public void testSystemStatusAnimation_systemInfoDisabled_staysInvisible() { + // GIVEN the status bar hides the system info via disable flags, while there is no event + CollapsedStatusBarFragment fragment = resumeAndGetFragment(); + when(mAnimationScheduler.getAnimationState()).thenReturn(IDLE); + fragment.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_SYSTEM_INFO, 0, false); + assertEquals(View.INVISIBLE, getSystemIconAreaView().getVisibility()); + + // WHEN the system event animation finishes + when(mAnimationScheduler.getAnimationState()).thenReturn(ANIMATING_OUT); + Animator anim = fragment.onSystemEventAnimationFinish(false); + anim.start(); + processAllMessages(); + anim.end(); + + // THEN the system info is at full alpha, but still INVISIBLE (since the disable flag is + // still set) + assertEquals(1, getSystemIconAreaView().getAlpha(), 0.01); + assertEquals(View.INVISIBLE, getSystemIconAreaView().getVisibility()); + } + + + @Test + public void testSystemStatusAnimation_notDisabled_animatesAlphaZero() { + // GIVEN the status bar is not disabled + CollapsedStatusBarFragment fragment = resumeAndGetFragment(); + when(mAnimationScheduler.getAnimationState()).thenReturn(ANIMATING_IN); + // WHEN the system event animation begins + Animator anim = fragment.onSystemEventAnimationBegin(); + anim.start(); + processAllMessages(); + anim.end(); + + // THEN the system info is visible but alpha 0 + assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility()); + assertEquals(0, getSystemIconAreaView().getAlpha(), 0.01); + } + + @Test + public void testSystemStatusAnimation_notDisabled_animatesBackToAlphaOne() { + // GIVEN the status bar is not disabled + CollapsedStatusBarFragment fragment = resumeAndGetFragment(); + when(mAnimationScheduler.getAnimationState()).thenReturn(ANIMATING_IN); + // WHEN the system event animation begins + Animator anim = fragment.onSystemEventAnimationBegin(); + anim.start(); + processAllMessages(); + anim.end(); + + // THEN the system info is visible but alpha 0 + assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility()); + assertEquals(0, getSystemIconAreaView().getAlpha(), 0.01); + + // WHEN the system event animation finishes + when(mAnimationScheduler.getAnimationState()).thenReturn(ANIMATING_OUT); + anim = fragment.onSystemEventAnimationFinish(false); + anim.start(); + processAllMessages(); + anim.end(); + + // THEN the syste info is full alpha and VISIBLE + assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility()); + assertEquals(1, getSystemIconAreaView().getAlpha(), 0.01); + } + + @Test public void testDisableNotifications() { CollapsedStatusBarFragment fragment = resumeAndGetFragment(); diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 4f222a4f8b83..6e7e31ad05c5 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -4666,6 +4666,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mPendingRemoteAnimation = options.getRemoteAnimationAdapter(); } mPendingRemoteTransition = options.getRemoteTransition(); + // Since options gets sent to client apps, remove transition information from it. + options.setRemoteTransition(null); + options.setRemoteAnimationAdapter(null); } void applyOptionsAnimation() { diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java index 01c94142f46b..a4c05eecdb07 100644 --- a/services/core/java/com/android/server/wm/KeyguardController.java +++ b/services/core/java/com/android/server/wm/KeyguardController.java @@ -41,6 +41,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS; import static com.android.server.wm.KeyguardControllerProto.AOD_SHOWING; +import static com.android.server.wm.KeyguardControllerProto.KEYGUARD_GOING_AWAY; import static com.android.server.wm.KeyguardControllerProto.KEYGUARD_PER_DISPLAY; import static com.android.server.wm.KeyguardControllerProto.KEYGUARD_SHOWING; @@ -594,6 +595,7 @@ class KeyguardController { } else if (top.canShowWhenLocked()) { mTopOccludesActivity = top; } + top.mDismissKeyguard = false; // Only the top activity may control occluded, as we can't occlude the Keyguard // if the top app doesn't want to occlude it. @@ -671,6 +673,7 @@ class KeyguardController { proto.write(KeyguardPerDisplayProto.KEYGUARD_SHOWING, mKeyguardShowing); proto.write(KeyguardPerDisplayProto.AOD_SHOWING, mAodShowing); proto.write(KeyguardPerDisplayProto.KEYGUARD_OCCLUDED, mOccluded); + proto.write(KeyguardPerDisplayProto.KEYGUARD_GOING_AWAY, mKeyguardGoingAway); proto.end(token); } } @@ -691,6 +694,7 @@ class KeyguardController { final long token = proto.start(fieldId); proto.write(AOD_SHOWING, default_state.mAodShowing); proto.write(KEYGUARD_SHOWING, default_state.mKeyguardShowing); + proto.write(KEYGUARD_GOING_AWAY, default_state.mKeyguardGoingAway); writeDisplayStatesToProto(proto, KEYGUARD_PER_DISPLAY); proto.end(token); } |