锁屏界面点击通话通知,进入通话过程中,闪现密码界面

1、问题描述

手机设置图案解锁,锁屏时来电接通后,返回锁屏点击通话通知。
进入通话界面过程中闪现密码界面。

2、涉及到的一些类:

加了一堆堆栈,此场景过程中一些关键的类如下:

动画
modified: animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt
modified: animation/src/com/android/systemui/animation/LaunchAnimator.kt
密码
modified: src/com/android/keyguard/KeyguardSecurityContainerController.java
启动动画开始结束的回调在这个类里
modified: src/com/android/systemui/keyguard/KeyguardViewMediator.java
真正显示密码界面
modified: src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
通知栏动作
modified: src/com/android/systemui/shade/NotificationPanelViewController.java
modified: src/com/android/systemui/shade/ShadeControllerImpl.java
modified: src/com/android/systemui/statusbar/NotificationMediaManager.java
点击通知栏
modified: src/com/android/systemui/statusbar/notification/NotificationClicker.java
显示隐藏密码界面,这里调用的StatusBarKeyguardViewManager.java
modified: src/com/android/systemui/statusbar/phone/CentralSurfaces.java
modified: src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
显示隐藏密码界面,这里调用到PrimaryBouncerInteractor.kt
modified: src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
点击通知启动应用入口
modified: src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java

3、点击通知栏的log

3.1 点击事件

12-10 20:53:32.562  2002  2002 I NotificationClicker: NotificationClicker onClick notification row.
12-10 20:53:32.562  2002  2002 I StatusBarNotificationActivityStarter: onNotificationClicked 
12-10 20:53:32.564  2002  2002 D StatusBarNotificationActivityStarter: onNotificationClicked isActivityIntent: true willLaunchResolverActivity: false animate: true showOverLockscreen: true
12-10 20:53:32.564  2002  2002 D StatusBarNotificationActivityStarter: onNotificationClicked onDismiss 
12-10 20:53:32.564  2002  2002 D StatusBarNotificationActivityStarter: handleNotificationClickAfterKeyguardDismissed showOverLockscreen : true runnable: com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarter$$ExternalSyntheticLambda3@dc32771

3.2 handleNotificationClickAfterKeyguardDismissed判断逻辑
如果是覆盖锁屏的应用,添加到runnable中

    private boolean handleNotificationClickAfterKeyguardDismissed(
            NotificationEntry entry,
            ExpandableNotificationRow row,
            PendingIntent intent,
            boolean isActivityIntent,
            boolean animate,
            boolean showOverLockscreen) {
        mLogger.logHandleClickAfterKeyguardDismissed(entry);

        final Runnable runnable = () -> handleNotificationClickAfterPanelCollapsed(
                entry, row, intent, isActivityIntent, animate);
        Log.d(TAG, "handleNotificationClickAfterKeyguardDismissed showOverLockscreen : "+showOverLockscreen+ " runnable: "+runnable);

        if (showOverLockscreen) {
            //走这里,把runnable添加进去,并展开通知栏
            mShadeController.addPostCollapseAction(runnable);
            mShadeController.collapseShade(true /* animate */);
        } else if (mKeyguardStateController.isShowing()
                && mCentralSurfaces.isOccluded()) {
            mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);
            mShadeController.collapseShade();
        } else {
            runnable.run();
        }

        // Always defer the keyguard dismiss when animating.
        return animate || !mNotificationPanel.isFullyCollapsed();
    }

3.3 click到NotificationPanelViewController.collapse的堆栈

12-10 20:53:32.565  2002  2002 D NotificationPanelView: collapse delayed: true  java.lang.Throwable
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.collapse(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:18)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.collapse(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:2)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.ShadeControllerImpl.animateCollapsePanels(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:99)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.ShadeControllerImpl.collapseShade(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:2)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.ShadeControllerImpl.collapseShade(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:4)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarter$1.onDismiss(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:98)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarter.onNotificationClicked(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:285)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.statusbar.notification.NotificationClicker.onClick(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:280)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.view.View.performClick(View.java:7686)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.systemui.statusbar.notification.row.ExpandableNotificationRow.performClick(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:4)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.view.View.performClickInternal(View.java:7659)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.view.View$PerformClick.run(View.java:30463)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.os.Handler.handleCallback(Handler.java:958)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.os.Looper.loopOnce(Looper.java:243)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.os.Looper.loop(Looper.java:338)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at android.app.ActivityThread.main(ActivityThread.java:8524)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at java.lang.reflect.Method.invoke(Native Method)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
12-10 20:53:32.565  2002  2002 D NotificationPanelView: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1064)

3.4 collapse调用mFlingCollapseRunnable
runnable里调用fling

12-10 20:53:32.565  2002  2002 D NotificationPanelView: collapse postDelayed(mFlingCollapseRunnable, 120) 

3.5 通知栏展开动画

12-10 20:53:32.686  2002  2002 I NotificationPanelView: createHeightAnimator: targetHeight 0.0 overshootAmount: 0.0 mOverExpansion: 0.0 mExpandedHeight: 778.0
12-10 20:53:32.686  2002  2002 D NotificationPanelView: flingToHeight: expand false target: 0.0 addOverscroll: false
12-10 20:53:32.686  2002  2002 D NotificationPanelView: setAnimator mPanelUpdateWhenAnimatorEnds: false
12-10 20:53:32.687  2002  2002 D NotificationPanelView: createHeightAnimator: animation.getAnimatedValue() 778.0

3.6 NotificationPanelViewController.fling到setExpandedHeightInternal堆栈

12-10 20:53:32.687  2002  2002 D NotificationPanelView: setExpandedHeightInternal h: 778.0  java.lang.Throwable
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.setExpandedHeightInternal(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:32)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController$$ExternalSyntheticLambda13.onAnimationUpdate(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:83)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.Animator$AnimatorCaller.lambda$static$4(Animator.java:858)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.Animator$AnimatorCaller$$ExternalSyntheticLambda6.call(Unknown Source:4)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.Animator.callOnList(Animator.java:669)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1645)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:771)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:734)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.ValueAnimator.start(ValueAnimator.java:1154)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.animation.ValueAnimator.start(ValueAnimator.java:1173)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.flingToHeight(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:406)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.fling(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:22)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController$$ExternalSyntheticLambda0.run(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:102)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.os.Handler.handleCallback(Handler.java:958)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.os.Looper.loopOnce(Looper.java:243)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.os.Looper.loop(Looper.java:338)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at android.app.ActivityThread.main(ActivityThread.java:8524)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at java.lang.reflect.Method.invoke(Native Method)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
12-10 20:53:32.687  2002  2002 D NotificationPanelView: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1064)
12-10 20:53:32.688  2002  2002 D NotificationPanelView: updateExpansionAndVisibility 000 mExpandedFraction: 1.0 isExpanded(): true mTracking false mExpansionDragDownAmountPx: 778.0
12-10 20:53:32.688  2002  2002 D NotificationPanelView: updateExpansionAndVisibility 000 updateVisibility shouldPanelBeVisible(): true
12-10 20:53:32.688  2002  2002 D NotificationPanelView: updateExpansionAndVisibility 111 

3.7 通知栏展开动画结束
onAnimationEnd

12-10 20:53:32.943  2002  2002 D NotificationPanelView: flingToHeight:onAnimationEnd 
12-10 20:53:32.943  2002  2002 D NotificationPanelView: onFlingEnd 0 
12-10 20:53:32.943  2002  2002 D NotificationPanelView: onFlingEnd 1 
12-10 20:53:32.943  2002  2002 D NotificationPanelView: setAnimator mPanelUpdateWhenAnimatorEnds: true
12-10 20:53:32.944  2002  2002 D NotificationPanelView: onFlingEnd 2 
12-10 20:53:32.944  2002  2002 D NotificationPanelView: onFlingEnd 3 
12-10 20:53:32.944  2002  2002 D NotificationPanelView: onFlingEnd 4 

3.8 NotificationPanelViewController.java onFlingEnd

    @VisibleForTesting
    void onFlingEnd(boolean cancelled) {
        Log.d(TAG, "onFlingEnd 0 ");
        mIsFlinging = false;
        // No overshoot when the animation ends
        setOverExpansionInternal(0, false /* isFromGesture */);
        Log.d(TAG, "onFlingEnd 1 ");
        setAnimator(null);
        Log.d(TAG, "onFlingEnd 2 ");
        mKeyguardStateController.notifyPanelFlingEnd();
        Log.d(TAG, "onFlingEnd 3 ");
        if (!cancelled) {
            mQsController.endJankMonitoring();
            Log.d(TAG, "onFlingEnd 4 ");
            //这里调下去启动应用
            notifyExpandingFinished();
        } else {
            mQsController.cancelJankMonitoring();
        }
        Log.d(TAG, "onFlingEnd 5 ");
        //这里调下去显示密码界面
        updateExpansionAndVisibility();
        mNotificationStackScrollLayoutController.setPanelFlinging(false);
        // expandImmediate should be always reset at the end of animation
        mQsController.setExpandImmediate(false);
    }

3.9 notifyExpandingFinished调用到启动应用的堆栈
runPostCollapseRunnables中会循环启动所有的runnable


12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: runPostCollapseRunnables : java.lang.Throwable
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.ShadeControllerImpl.runPostCollapseRunnables(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:10)
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.ShadeControllerImpl.onClosingFinished(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:1)
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.NotificationPanelViewController.endClosing(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:13)
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.NotificationPanelViewController.notifyExpandingFinished(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:1)
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.NotificationPanelViewController.onFlingEnd(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:63)
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.NotificationPanelViewController$6.onAnimationEnd(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:83)
12-10 20:53:32.944  2002  2002 D ShadeControllerImpl: 	at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:711)

3.10 runnable启动,真正的启动通话应用com.android.dialer

12-10 20:53:32.944  2002  2002 W ShadeControllerImpl: runPostCollapseRunnables runnable: com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarter$$ExternalSyntheticLambda3@dc32771
12-10 20:53:32.944  2002  2002 E StatusBarNotificationActivityStarter: handleNotificationClickAfterPanelCollapsed 
12-10 20:53:32.945  2002  2002 D StatusBarNotificationActivityStarter: handleNotificationClickAfterPanelCollapsed canBubble:false
12-10 20:53:32.945  2002  2002 D StatusBarNotificationActivityStarter: startNotificationIntent mActivityLaunchAnimator.startPendingIntentWithAnimation 111 animate:true
12-10 20:53:32.945  2002  2002 I ActivityLaunchAnimator: createRunner controller.isDialogLaunch: false isEmergency: false
12-10 20:53:32.946  2002  2002 I ActivityLaunchAnimator:  startIntentWithAnimation  hideKeyguardWithAnimation true packageName: com.android.dialer showOverLockscreen: false
12-10 20:53:32.946  2002  2002 D StatusBarNotificationActivityStarter: startNotificationIntent mActivityLaunchAnimator.startPendingIntentWithAnimation 222 animate:true eventTime: 3585756

12-10 20:53:32.988  2002  2002 D NotificationPanelView: onFlingEnd 5 

3.11 状态改变

12-10 20:53:32.989  2002  2002 D NotificationPanelView: onPanelStateChanged:state 0
12-10 20:53:32.989  2002  2002 D NotificationPanelView: onPanelStateChanged mView.post(mMaybeHideExpandedRunnable): 

12-10 20:53:33.005  2002  2002 D NotificationPanelView: mMaybeHideExpandedRunnable

3.12 显示隐藏密码界面堆栈

12-10 20:53:33.027  2002  2002 D CentralSurfaces: showBouncerOrLockScreenIfKeyguard isHiding false isKeyguardGoingAway(): false
12-10 20:53:33.027  2002  2002 D CentralSurfaces: showBouncerOrLockScreenIfKeyguard mState 1 primaryBouncerIsOrWillBeShowing(): false isKeyguardSecure(): true
12-10 20:53:33.027  2002  2002 D CentralSurfaces: showBouncerOrLockScreenIfKeyguard  mStatusBarKeyguardViewManager.showBouncer isOccluded false  java.lang.Throwable
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at com.android.systemui.shade.ShadeControllerImpl.notifyExpandedVisibleChanged(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:164)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at com.android.systemui.shade.ShadeControllerImpl.makeExpandedInvisible(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:90)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at com.android.systemui.statusbar.phone.CentralSurfacesImpl$$ExternalSyntheticLambda13.run(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:15)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at android.os.Handler.handleCallback(Handler.java:958)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at android.os.Looper.loopOnce(Looper.java:243)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at android.os.Looper.loop(Looper.java:338)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at android.app.ActivityThread.main(ActivityThread.java:8524)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at java.lang.reflect.Method.invoke(Native Method)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
12-10 20:53:33.027  2002  2002 D CentralSurfaces: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1064)

12-10 20:53:33.027  2002  2002 D StatusBarKeyguardViewManager: showBouncer(scrimmed = true)
//PrimaryBouncerInteractor中显示密码界面
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: show isScrimmed: truejava.lang.Throwable
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor.show(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:3)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showPrimaryBouncer(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:21)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncer(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:45)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.shade.ShadeControllerImpl.notifyExpandedVisibleChanged(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:181)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.shade.ShadeControllerImpl.makeExpandedInvisible(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:90)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.statusbar.phone.CentralSurfacesImpl$$ExternalSyntheticLambda13.run(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:15)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Handler.handleCallback(Handler.java:958)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Looper.loopOnce(Looper.java:243)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Looper.loop(Looper.java:338)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at android.app.ActivityThread.main(ActivityThread.java:8524)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at java.lang.reflect.Method.invoke(Native Method)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1064)
12-10 20:53:33.029  2002  2002 D PrimaryBouncerInteractor: show resumeBouncer: false

12-10 20:53:33.030  2002  2002 D KeyguardSecurityView: showNextSecurityScreenOrFinish(false): 
12-10 20:53:33.030  2002  2002 D KeyguardSecurityView: showNext.. mCurrentSecurityMode = Pattern
12-10 20:53:33.030  2002  2002 D KeyguardSecurityView: showNextSecurityScreenOrFinish() - return finish = false mCurrentSecurityMode: Pattern
12-10 20:53:33.039  2002  2002 D PrimaryBouncerInteractor: show end: 

12-10 20:53:33.075  2002  2002 D PrimaryBouncerInteractor: sideFpsToShow=false
12-10 20:53:33.075  2002  2002 D PrimaryBouncerInteractor: isBouncerShowing=true
12-10 20:53:33.075  2002  2002 D PrimaryBouncerInteractor: configEnabled=true
12-10 20:53:33.075  2002  2002 D PrimaryBouncerInteractor: fpsDetectionRunning=false
12-10 20:53:33.075  2002  2002 D PrimaryBouncerInteractor: isUnlockingWithFpAllowed=false
12-10 20:53:33.075  2002  2002 D PrimaryBouncerInteractor: isAnimatingAway=false

3.13 启动动画开始
隐藏密码界面堆栈

12-10 20:53:33.172  2002  2098 D KeyguardViewMediator: onAnimationStart isEmergency : false
12-10 20:53:33.172  2002  2098 I ActivityLaunchAnimator: createRunner controller.isDialogLaunch: false isEmergency: false
12-10 20:53:33.198  2002  2098 D KeyguardViewMediator: OccludeAnimator#onAnimationStart. Set occluded = true.
12-10 20:53:33.198  2002  2098 D KeyguardViewMediator: setOccluded(true)
12-10 20:53:33.198  2002  2098 D KeyguardViewMediator: setOccluded true
12-10 20:53:33.208  2002  2002 D KeyguardViewMediator: handleSetOccluded(true)
12-10 20:53:33.215  2002  2002 D StatusBarKeyguardViewManager: reset hideBouncerWhenShowing: true
12-10 20:53:33.216  2002  2002 D StatusBarKeyguardViewManager: reset isOccluded: true mDozing: false
12-10 20:53:33.216  2002  2002 D StatusBarKeyguardViewManager: hideBouncer(destroyView = false)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: hide start  java.lang.Throwable
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor.hide(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:3)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.hideBouncer(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:27)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.reset(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:70)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.setOccluded(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:114)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.keyguard.KeyguardViewMediator.-$$Nest$mhandleSetOccluded(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:121)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.systemui.keyguard.KeyguardViewMediator$12.handleMessage(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:324)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Handler.dispatchMessage(Handler.java:106)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Looper.loopOnce(Looper.java:243)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at android.os.Looper.loop(Looper.java:338)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at android.app.ActivityThread.main(ActivityThread.java:8524)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at java.lang.reflect.Method.invoke(Native Method)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
12-10 20:53:33.216  2002  2002 D PrimaryBouncerInteractor: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1064)

12-10 20:53:33.413  2002  2002 D PrimaryBouncerInteractor: sideFpsToShow=false
12-10 20:53:33.413  2002  2002 D PrimaryBouncerInteractor: isBouncerShowing=false
12-10 20:53:33.413  2002  2002 D PrimaryBouncerInteractor: configEnabled=true
12-10 20:53:33.413  2002  2002 D PrimaryBouncerInteractor: fpsDetectionRunning=false
12-10 20:53:33.413  2002  2002 D PrimaryBouncerInteractor: isUnlockingWithFpAllowed=false
12-10 20:53:33.413  2002  2002 D PrimaryBouncerInteractor: isAnimatingAway=false

3.14 启动动画结束

12-10 20:53:33.705  2002  2002 D NotificationPanelView: setExpandedHeightInternal h: 0.0  java.lang.Throwable
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.setExpandedHeightInternal(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:32)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.setExpandedHeight(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:35)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.setExpandedFraction(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:7)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.shade.NotificationPanelViewController.instantCollapse(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:12)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.keyguard.KeyguardViewMediator$5.onLaunchAnimationEnd(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:17)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.animation.ActivityLaunchAnimator$AnimationDelegate$startAnimation$controller$1.onLaunchAnimationEnd(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:24)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at com.android.systemui.animation.LaunchAnimator$startAnimation$1.onAnimationEnd(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:5)
12-10 20:53:33.705  2002  2002 D NotificationPanelView: 	at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:711)

//
12-10 20:53:33.984  2002  2002 I ActivityLaunchAnimator: Remote animation timed out
12-10 20:53:33.991  2002  2002 D CentralSurfaces: onLaunchAnimationCancelled isLaunchForActivity : true isPresenterFullyCollapsed(): true !mPresenter.isCollapsing(): true isLaunchAnimationRunning: false
12-10 20:53:33.991  2002  2002 D CentralSurfaces: onLaunchAnimationCancelled 111 : 
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: runPostCollapseRunnables : java.lang.Throwable
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.ShadeControllerImpl.runPostCollapseRunnables(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:10)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.shade.ShadeControllerImpl.onClosingFinished(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:1)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.statusbar.phone.StatusBarLaunchAnimatorController.onLaunchAnimationCancelled(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:120)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at com.android.systemui.animation.ActivityLaunchAnimator$AnimationDelegate$onTimeout$1.run(go/retraceme 7c7a4cd3d496a6605f06d96bb58a365cdf103aa085e673f78dd8e8b3b7ab2e61:29)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at android.os.Handler.handleCallback(Handler.java:958)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at android.os.Looper.loopOnce(Looper.java:243)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at android.os.Looper.loop(Looper.java:338)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at android.app.ActivityThread.main(ActivityThread.java:8524)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at java.lang.reflect.Method.invoke(Native Method)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
12-10 20:53:33.992  2002  2002 D ShadeControllerImpl: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1064)

12-10 20:53:33.763  2002  2002 D CentralSurfaces: showBouncerOrLockScreenIfKeyguard isHiding false isKeyguardGoingAway(): false
12-10 20:53:33.763  2002  2002 D CentralSurfaces: showBouncerOrLockScreenIfKeyguard mState 0 primaryBouncerIsOrWillBeShowing(): false isKeyguardSecure(): true
4、问题原因

NotificationPanelViewController.java onFlingEnd中
调用启动应用,再显示密码界面, Google原生设计如此.
启动应用需要时间,在次期间,通知栏已经展开,updateExpansionAndVisibility里面显示了密码界面,作为过度.

5、解决方案

handleNotificationClickAfterKeyguardDismissed方法中

    private boolean handleNotificationClickAfterKeyguardDismissed(
            NotificationEntry entry,
            ExpandableNotificationRow row,
            PendingIntent intent,
            boolean isActivityIntent,
            boolean animate,
            boolean showOverLockscreen) {
        mLogger.logHandleClickAfterKeyguardDismissed(entry);

        final Runnable runnable = () -> handleNotificationClickAfterPanelCollapsed(
                entry, row, intent, isActivityIntent, animate);
        Log.d(TAG, "handleNotificationClickAfterKeyguardDismissed showOverLockscreen : "+showOverLockscreen+ " runnable: "+runnable);

        if (showOverLockscreen) {
        //不展开通知栏,直接启动runnable
//            mShadeController.addPostCollapseAction(runnable);
//            mShadeController.collapseShade(true /* animate */);
            runnable.run();
        } else if (mKeyguardStateController.isShowing()
                && mCentralSurfaces.isOccluded()) {
            mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);
            mShadeController.collapseShade();
        } else {
            runnable.run();
        }

        // Always defer the keyguard dismiss when animating.
        return animate || !mNotificationPanel.isFullyCollapsed();
    }

这个方案会直接启动通话界面。减少通知栏展开过程。

另一个方案,不修改原生的流程,
在点击事件方法里,判断是showOverLockscreen,保存全局变量,在动画结束时onLaunchAnimationEnd 恢复变量。

//判断isShowOverLockscreen && shouldPanelBeVisible 直接return.
状态和标志位都不动,只是view不Visible.
这个方案完全针对此bug,效果是通知栏动画展开后,锁屏只剩下壁纸,然后进入通话界面。
逻辑有点怪,要显示,强行不让显示。是一个补丁。

    public void updateExpansionAndVisibility() {
        mShadeExpansionStateManager.onPanelExpansionChanged(
                mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx);

        if (mCentralSurfaces != null && mCentralSurfaces.isShowOverLockscreen() && shouldPanelBeVisible()) {
            Log.w(TAG," updateVisibility return; isShowOverLockscreen: "+mCentralSurfaces.isShowOverLockscreen()+" shouldPanelBeVisible(): "+shouldPanelBeVisible());
            return;
        }
        updateVisibility();
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值