Use logout button + owner for max # notifs calc

In the calculation for the max # notifications to show on the lock
screen, take into consideration the height of the logout button and
owner information.

Test: atest SystemUITests, manual
Bug: 170228350
Change-Id: Ia12c85df27b16d432608fef8a52eb0d4c9ff79ff
This commit is contained in:
Beverly
2020-11-20 10:38:37 -05:00
parent 8b0cc5a24c
commit 9f515695ae
4 changed files with 26 additions and 2 deletions

View File

@@ -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;

View File

@@ -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.
*/

View File

@@ -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

View File

@@ -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);
}