Brad Stenning | 7e41181 | 2018-04-13 22:52:39 -0700 | [diff] [blame] | 1 | package com.android.systemui.statusbar.car; |
| 2 | |
| 3 | import android.content.Context; |
| 4 | import android.view.View; |
| 5 | |
| 6 | import com.android.internal.widget.LockPatternUtils; |
| 7 | import com.android.keyguard.ViewMediatorCallback; |
| 8 | import com.android.systemui.R; |
| 9 | import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; |
| 10 | |
| 11 | public class CarStatusBarKeyguardViewManager extends StatusBarKeyguardViewManager { |
| 12 | |
| 13 | protected boolean mShouldHideNavBar; |
| 14 | |
| 15 | public CarStatusBarKeyguardViewManager(Context context, |
| 16 | ViewMediatorCallback callback, |
| 17 | LockPatternUtils lockPatternUtils) { |
| 18 | super(context, callback, lockPatternUtils); |
| 19 | mShouldHideNavBar =context.getResources() |
| 20 | .getBoolean(R.bool.config_hideNavWhenKeyguardBouncerShown); |
| 21 | } |
| 22 | |
| 23 | @Override |
| 24 | protected void updateNavigationBarVisibility(boolean navBarVisible) { |
| 25 | if(!mShouldHideNavBar) { |
| 26 | return; |
| 27 | } |
| 28 | CarStatusBar statusBar = (CarStatusBar) mStatusBar; |
| 29 | statusBar.setNavBarVisibility(navBarVisible ? View.VISIBLE : View.GONE); |
| 30 | } |
Jian Jin | d1b6398 | 2018-05-21 15:20:40 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Car is a multi-user system. There's a cancel button on the bouncer that allows the user to |
| 34 | * go back to the user switcher and select another user. Different user may have different |
| 35 | * security mode which requires bouncer container to be resized. For this reason, the bouncer |
| 36 | * view is destroyed on cancel. |
| 37 | */ |
| 38 | @Override |
| 39 | protected boolean shouldDestroyViewOnReset() { |
| 40 | return true; |
| 41 | } |
Aarthi Balachander | 0a427ef | 2018-07-13 15:00:58 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * Called when cancel button in bouncer is pressed. |
| 45 | */ |
| 46 | @Override |
| 47 | public void onCancelClicked() { |
| 48 | CarStatusBar statusBar = (CarStatusBar) mStatusBar; |
| 49 | statusBar.showUserSwitcher(); |
| 50 | } |
Brad Stenning | 7e41181 | 2018-04-13 22:52:39 -0700 | [diff] [blame] | 51 | } |