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

This commit is contained in:
TreeHugger Robot
2020-11-21 01:06:51 +00:00
committed by Android (Google) Code Review
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);
}