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

Commit 577a07c0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use logout button + owner for max # notifs calc"

parents 531245a7 9f515695
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -178,6 +178,13 @@ public class KeyguardStatusView extends GridLayout {
        return mLogoutView.getVisibility() == VISIBLE ? mLogoutView.getHeight() : 0;
    }

    int getOwnerInfoHeight() {
        if (mOwnerInfo == null) {
            return 0;
        }
        return mOwnerInfo.getVisibility() == VISIBLE ? mOwnerInfo.getHeight() : 0;
    }

    void updateLogoutView() {
        if (mLogoutView == null) {
            return;
+7 −0
Original line number Diff line number Diff line
@@ -129,6 +129,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
        return mView.getLogoutButtonHeight();
    }

    /**
     * Get the height of the logout button.
     */
    public int getOwnerInfoHeight() {
        return mView.getOwnerInfoHeight();
    }

    /**
     * Set keyguard status view alpha.
     */
+10 −2
Original line number Diff line number Diff line
@@ -1861,7 +1861,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            @Override
            public void onChange(boolean selfChange) {
                updateLockScreenMode();
                mHandler.sendEmptyMessage(MSG_LOCK_SCREEN_MODE);
            }
        };
        mContext.getContentResolver().registerContentObserver(
@@ -1870,14 +1869,22 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    }

    private void updateLockScreenMode() {
        mLockScreenMode = Settings.Global.getInt(mContext.getContentResolver(),
        final int newMode = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_NEW_LOCKSCREEN,
                isUdfpsEnrolled() ? 1 : 0);
        if (newMode != mLockScreenMode) {
            mLockScreenMode = newMode;
            mHandler.sendEmptyMessage(MSG_LOCK_SCREEN_MODE);
        }
    }

    private void updateUdfpsEnrolled(int userId) {
        mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId);
    }

    /**
     * @return true if there's at least one udfps enrolled
     */
    public boolean isUdfpsEnrolled() {
        return mIsUdfpsEnrolled;
    }
@@ -1917,6 +1924,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            return;
        }

        // TODO: Add support for multiple fingerprint sensors, b/173730729
        boolean shouldListenForFingerprint =
                isUdfpsEnrolled() ? shouldListenForUdfps() : shouldListenForFingerprint();
        boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING
+2 −0
Original line number Diff line number Diff line
@@ -926,6 +926,8 @@ public class NotificationPanelViewController extends PanelViewController {
        if (mUpdateMonitor.isUdfpsEnrolled()) {
            availableSpace = mNotificationStackScrollLayoutController.getHeight()
                    - minPadding - shelfSize
                    - mKeyguardStatusViewController.getOwnerInfoHeight()
                    - mKeyguardStatusViewController.getLogoutButtonHeight()
                    - (mStatusBar.getDisplayHeight() - mAuthController.getUdfpsRegion().top);
        }