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

Commit 56e87c7d authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

Merge "[Keyguard] Fix unlock animation for occluded LS." into tm-qpr-dev am:...

Merge "[Keyguard] Fix unlock animation for occluded LS." into tm-qpr-dev am: 4f58e036 am: d5abe8d3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19211093



Change-Id: Ib8ca4f8cd5a12f87a89ed6aab3b84d4522ae42ec
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 608c190f d5abe8d3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2515,8 +2515,13 @@ public class CentralSurfacesImpl extends CoreStartable implements
                callback.onActivityStarted(ActivityManager.START_CANCELED);
            }
        };
        // Do not deferKeyguard when occluded because, when keyguard is occluded,
        // we do not launch the activity until keyguard is done.
        boolean occluded = mStatusBarKeyguardViewManager.isShowing()
                && mStatusBarKeyguardViewManager.isOccluded();
        boolean deferred = !occluded;
        executeRunnableDismissingKeyguard(runnable, cancelRunnable, dismissShadeDirectly,
                willLaunchResolverActivity, true /* deferred */, animate);
                willLaunchResolverActivity, deferred /* deferred */, animate);
    }

    @Nullable
+19 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.systemui.statusbar.phone;
import static android.app.NotificationManager.IMPORTANCE_HIGH;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK;

import static com.google.common.truth.Truth.assertThat;

import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static junit.framework.TestCase.fail;
@@ -44,6 +46,7 @@ import android.app.WallpaperManager;
import android.app.trust.TrustManager;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.devicestate.DeviceStateManager;
import android.hardware.display.AmbientDisplayConfiguration;
@@ -984,6 +987,22 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
        verify(mStatusBarStateController, never()).setLeaveOpenOnKeyguardHide(true);
    }

    @Test
    public void startActivityDismissingKeyguard_isShowingandIsOccluded() {
        when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true);
        when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(true);
        mCentralSurfaces.startActivityDismissingKeyguard(
                new Intent(),
                /* onlyProvisioned = */false,
                /* dismissShade = */false);
        verify(mStatusBarKeyguardViewManager).addAfterKeyguardGoneRunnable(any(Runnable.class));
        ArgumentCaptor<OnDismissAction> onDismissActionCaptor =
                ArgumentCaptor.forClass(OnDismissAction.class);
        verify(mStatusBarKeyguardViewManager)
                .dismissWithAction(onDismissActionCaptor.capture(), any(Runnable.class), eq(true));
        assertThat(onDismissActionCaptor.getValue().onDismiss()).isFalse();
    }

    private void setDeviceState(int state) {
        ArgumentCaptor<DeviceStateManager.DeviceStateCallback> callbackCaptor =
                ArgumentCaptor.forClass(DeviceStateManager.DeviceStateCallback.class);