|
33 | 33 | import android.app.admin.DevicePolicyManager; |
34 | 34 | import android.content.Context; |
35 | 35 | import android.content.Intent; |
| 36 | +import android.content.pm.PackageManager; |
36 | 37 | import android.content.res.ColorStateList; |
37 | 38 | import android.graphics.Insets; |
38 | 39 | import android.graphics.Rect; |
|
79 | 80 | import com.android.systemui.statusbar.policy.KeyguardStateController; |
80 | 81 | import com.android.systemui.util.InjectionInflationController; |
81 | 82 |
|
| 83 | +import com.android.internal.util.nad.fod.FodUtils; |
| 84 | + |
82 | 85 | import java.util.List; |
83 | 86 |
|
84 | 87 | public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSecurityView { |
@@ -124,6 +127,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe |
124 | 127 | private InjectionInflationController mInjectionInflationController; |
125 | 128 | private boolean mSwipeUpToRetry; |
126 | 129 | private AdminSecondaryLockScreenController mSecondaryLockScreenController; |
| 130 | + private boolean mHasFod; |
127 | 131 |
|
128 | 132 | private final ViewConfiguration mViewConfiguration; |
129 | 133 | private final SpringAnimation mSpringAnimation; |
@@ -261,6 +265,9 @@ public KeyguardSecurityContainer(Context context, AttributeSet attrs, int defSty |
261 | 265 | mKeyguardStateController = Dependency.get(KeyguardStateController.class); |
262 | 266 | mSecondaryLockScreenController = new AdminSecondaryLockScreenController(context, this, |
263 | 267 | mUpdateMonitor, mCallback, new Handler(Looper.myLooper())); |
| 268 | + |
| 269 | + PackageManager packageManager = mContext.getPackageManager(); |
| 270 | + mHasFod = FodUtils.hasFodSupport(context); |
264 | 271 | } |
265 | 272 |
|
266 | 273 | public void setSecurityCallback(SecurityCallback callback) { |
@@ -517,8 +524,9 @@ public WindowInsets onApplyWindowInsets(WindowInsets insets) { |
517 | 524 |
|
518 | 525 | // Consume bottom insets because we're setting the padding locally (for IME and navbar.) |
519 | 526 | int inset; |
520 | | - int minBottomMargin = getResources().getDimensionPixelSize( |
521 | | - R.dimen.kg_security_container_min_bottom_margin); |
| 527 | + int minBottomMargin = mHasFod && mUpdateMonitor.isFingerprintDetectionRunning() ? |
| 528 | + getResources().getDimensionPixelSize( |
| 529 | + R.dimen.kg_security_container_min_bottom_margin) : 0; |
522 | 530 |
|
523 | 531 | if (sNewInsetsMode == NEW_INSETS_MODE_FULL) { |
524 | 532 | int bottomInset = insets.getInsetsIgnoringVisibility(systemBars()).bottom; |
|
0 commit comments