diff options
author | Dave Mankoff <mankoff@google.com> | 2021-02-09 16:58:40 -0500 |
---|---|---|
committer | Dave Mankoff <mankoff@google.com> | 2021-02-16 12:28:55 -0500 |
commit | b8b5aa4ed2e7499cb6e1b84d9d68202b65d033b5 (patch) | |
tree | 70d17da134915f5caad14977dfdc88a1d5a0879a /packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java | |
parent | 000e4071584a3b43eadb3be4403448dd66097cdc (diff) |
Remove Dependency.get from KeyguardStatusView.
Bug: 179775696
Test: atest SystemUITests && manual
Change-Id: Ifbb93e624d839d7506b45da2cabb4fcf8b0b75ff
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java index 6fb6760be653..bfe7f8c7ebd8 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java @@ -16,6 +16,7 @@ package com.android.keyguard; +import android.os.UserHandle; import android.util.Slog; import android.view.View; @@ -78,6 +79,8 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV @Override public void onInit() { mKeyguardClockSwitchController.init(); + mView.setEnableMarquee(mKeyguardUpdateMonitor.isDeviceInteractive()); + mView.updateLogoutView(shouldShowLogout()); } @Override @@ -245,6 +248,11 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV } } + private boolean shouldShowLogout() { + return mKeyguardUpdateMonitor.isLogoutEnabled() + && KeyguardUpdateMonitor.getCurrentUser() != UserHandle.USER_SYSTEM; + } + private final ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { @Override @@ -271,12 +279,12 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV mKeyguardSliceViewController.updateTopMargin( mKeyguardClockSwitchController.getClockTextTopPadding()); mView.setCanShowOwnerInfo(false); - mView.setCanShowLogout(false); + mView.updateLogoutView(false); } else { // reset margin mKeyguardSliceViewController.updateTopMargin(0); mView.setCanShowOwnerInfo(true); - mView.setCanShowLogout(false); + mView.updateLogoutView(false); } updateAodIcons(); } @@ -302,7 +310,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV if (DEBUG) Slog.v(TAG, "refresh statusview showing:" + showing); refreshTime(); mView.updateOwnerInfo(); - mView.updateLogoutView(); + mView.updateLogoutView(shouldShowLogout()); } } @@ -320,12 +328,12 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV public void onUserSwitchComplete(int userId) { mKeyguardClockSwitchController.refreshFormat(); mView.updateOwnerInfo(); - mView.updateLogoutView(); + mView.updateLogoutView(shouldShowLogout()); } @Override public void onLogoutEnabledChanged() { - mView.updateLogoutView(); + mView.updateLogoutView(shouldShowLogout()); } }; } |