diff options
author | Beverly <beverlyt@google.com> | 2021-02-03 09:58:26 -0500 |
---|---|---|
committer | Beverly <beverlyt@google.com> | 2021-02-09 08:35:31 -0500 |
commit | aac8e536ab2411a0febacbcfaae1fe79d85f556c (patch) | |
tree | f819c4d36572c77eec9006217356eedd173f6959 /packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java | |
parent | 5e8177bf787c384f914fa9bb388a871afd6e25fa (diff) |
Rotate keyguard indication messages
In the new LS layout, we show the following messages in the keyguard
bottom area instead of in the KeyguardStatusView:
- Logout button
- Owner information
We also now show now playing as part of the rotating text on the lock
screen.
Bug: 178794517
Test: atest SystemUITest, manual
Change-Id: I1a0a47e300d1f9e5fe11c17d143e5a8f0ad8af60
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java index 97aa26fb7f68..fea152abe36a 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java @@ -56,8 +56,10 @@ public class KeyguardStatusView extends GridLayout { private final IActivityManager mIActivityManager; private TextView mLogoutView; + private boolean mCanShowLogout = true; // by default, try to show the logout button here private KeyguardClockSwitch mClockView; private TextView mOwnerInfo; + private boolean mCanShowOwnerInfo = true; // by default, try to show the owner information here private KeyguardSliceView mKeyguardSlice; private View mNotificationIcons; private Runnable mPendingMarqueeStart; @@ -114,6 +116,25 @@ public class KeyguardStatusView extends GridLayout { if (mOwnerInfo != null) mOwnerInfo.setSelected(enabled); } + void setCanShowOwnerInfo(boolean canShowOwnerInfo) { + mCanShowOwnerInfo = canShowOwnerInfo; + mOwnerInfo = findViewById(R.id.owner_info); + if (mOwnerInfo != null) { + if (mCanShowOwnerInfo) { + mOwnerInfo.setVisibility(VISIBLE); + updateOwnerInfo(); + } else { + mOwnerInfo.setVisibility(GONE); + mOwnerInfo = null; + } + } + } + + void setCanShowLogout(boolean canShowLogout) { + mCanShowLogout = canShowLogout; + updateLogoutView(); + } + @Override protected void onFinishInflate() { super.onFinishInflate(); @@ -128,7 +149,10 @@ public class KeyguardStatusView extends GridLayout { if (KeyguardClockAccessibilityDelegate.isNeeded(mContext)) { mClockView.setAccessibilityDelegate(new KeyguardClockAccessibilityDelegate(mContext)); } - mOwnerInfo = findViewById(R.id.owner_info); + if (mCanShowOwnerInfo) { + mOwnerInfo = findViewById(R.id.owner_info); + } + mKeyguardSlice = findViewById(R.id.keyguard_status_area); mTextColor = mClockView.getCurrentTextColor(); @@ -189,7 +213,7 @@ public class KeyguardStatusView extends GridLayout { if (mLogoutView == null) { return; } - mLogoutView.setVisibility(shouldShowLogout() ? VISIBLE : GONE); + mLogoutView.setVisibility(mCanShowLogout && shouldShowLogout() ? VISIBLE : GONE); // Logout button will stay in language of user 0 if we don't set that manually. mLogoutView.setText(mContext.getResources().getString( com.android.internal.R.string.global_action_logout)); |