diff options
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()); } }; } |