diff options
author | LuK1337 <priv.luk@gmail.com> | 2023-03-30 20:54:59 +0200 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
commit | 9919ab3dd0774cb6af62ea5a6472971547d46931 (patch) | |
tree | 68d97558e34179d94a4e2b9f7dc454c4ad8f5daa | |
parent | 31cbe9d5d2e39d55b46e5856eaa8a8f7a9c36919 (diff) |
SystemUI: Avoid unnecessary keyguard indication controller recreation
This basically prevents us from running into situation where there are
two controllers running in the background.
Change-Id: I13781e3dd6cb3c2f75efad77fed214bae8d9be87
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index 6a658b6ee047..3301d6907a25 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -304,10 +304,12 @@ public class KeyguardIndicationController { R.id.keyguard_indication_text_bottom); mInitialTextColorState = mTopIndicationView != null ? mTopIndicationView.getTextColors() : ColorStateList.valueOf(Color.WHITE); - mRotateTextViewController = new KeyguardIndicationRotateTextViewController( - mLockScreenIndicationView, - mExecutor, - mStatusBarStateController); + if (mRotateTextViewController == null || !mRotateTextViewController.isAttachedToWindow()) { + mRotateTextViewController = new KeyguardIndicationRotateTextViewController( + mLockScreenIndicationView, + mExecutor, + mStatusBarStateController); + } updateDeviceEntryIndication(false /* animate */); updateOrganizedOwnedDevice(); if (mBroadcastReceiver == null) { |