Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +25 −15 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ import androidx.annotation.VisibleForTesting; import com.android.systemui.Dumpable; import com.android.systemui.Dumpable; import com.android.systemui.common.ui.ConfigurationState; import com.android.systemui.common.ui.ConfigurationState; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlagsClassic; import com.android.systemui.flags.FeatureFlagsClassic; Loading Loading @@ -78,6 +79,7 @@ import com.android.systemui.util.settings.SecureSettings; import java.io.PrintWriter; import java.io.PrintWriter; import java.util.Locale; import java.util.Locale; import java.util.concurrent.Executor; import java.util.function.Consumer; import java.util.function.Consumer; import javax.inject.Inject; import javax.inject.Inject; Loading Loading @@ -136,6 +138,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private KeyguardInteractor mKeyguardInteractor; private KeyguardInteractor mKeyguardInteractor; private KeyguardClockInteractor mKeyguardClockInteractor; private KeyguardClockInteractor mKeyguardClockInteractor; private final DelayableExecutor mUiExecutor; private final DelayableExecutor mUiExecutor; private final Executor mBgExecutor; private boolean mCanShowDoubleLineClock = true; private boolean mCanShowDoubleLineClock = true; private DisposableHandle mAodIconsBindHandle; private DisposableHandle mAodIconsBindHandle; @Nullable private NotificationIconContainer mAodIconContainer; @Nullable private NotificationIconContainer mAodIconContainer; Loading Loading @@ -186,6 +189,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS KeyguardUnlockAnimationController keyguardUnlockAnimationController, KeyguardUnlockAnimationController keyguardUnlockAnimationController, SecureSettings secureSettings, SecureSettings secureSettings, @Main DelayableExecutor uiExecutor, @Main DelayableExecutor uiExecutor, @Background Executor bgExecutor, DumpManager dumpManager, DumpManager dumpManager, ClockEventController clockEventController, ClockEventController clockEventController, @KeyguardClockLog LogBuffer logBuffer, @KeyguardClockLog LogBuffer logBuffer, Loading @@ -209,6 +213,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mIconViewBindingFailureTracker = iconViewBindingFailureTracker; mIconViewBindingFailureTracker = iconViewBindingFailureTracker; mSecureSettings = secureSettings; mSecureSettings = secureSettings; mUiExecutor = uiExecutor; mUiExecutor = uiExecutor; mBgExecutor = bgExecutor; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mDumpManager = dumpManager; mDumpManager = dumpManager; mClockEventController = clockEventController; mClockEventController = clockEventController; Loading Loading @@ -328,6 +333,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS updateAodIcons(); updateAodIcons(); mStatusArea = mView.findViewById(R.id.keyguard_status_area); mStatusArea = mView.findViewById(R.id.keyguard_status_area); mBgExecutor.execute(() -> { mSecureSettings.registerContentObserverForUser( mSecureSettings.registerContentObserverForUser( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, false, /* notifyForDescendants */ false, /* notifyForDescendants */ Loading @@ -341,6 +347,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mShowWeatherObserver, mShowWeatherObserver, UserHandle.USER_ALL UserHandle.USER_ALL ); ); }); updateDoubleLineClock(); updateDoubleLineClock(); mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener( mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener( Loading Loading @@ -382,8 +390,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mClockEventController.unregisterListeners(); mClockEventController.unregisterListeners(); setClock(null); setClock(null); mBgExecutor.execute(() -> { mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver); mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver); mSecureSettings.unregisterContentObserver(mShowWeatherObserver); mSecureSettings.unregisterContentObserver(mShowWeatherObserver); }); mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener( mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener( mKeyguardUnlockAnimationListener); mKeyguardUnlockAnimationListener); Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -195,6 +195,7 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase { mKeyguardUnlockAnimationController, mKeyguardUnlockAnimationController, mSecureSettings, mSecureSettings, mExecutor, mExecutor, mExecutor, mDumpManager, mDumpManager, mClockEventController, mClockEventController, mLogBuffer, mLogBuffer, Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -157,6 +157,7 @@ public class KeyguardClockSwitchControllerTest extends KeyguardClockSwitchContro ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor.forClass(ContentObserver.class); ArgumentCaptor.forClass(ContentObserver.class); mController.init(); mController.init(); mExecutor.runAllReady(); verify(mSecureSettings).registerContentObserverForUser( verify(mSecureSettings).registerContentObserverForUser( eq(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK), eq(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK), anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL)); anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL)); Loading Loading @@ -212,6 +213,7 @@ public class KeyguardClockSwitchControllerTest extends KeyguardClockSwitchContro ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor.forClass(ContentObserver.class); ArgumentCaptor.forClass(ContentObserver.class); mController.init(); mController.init(); mExecutor.runAllReady(); verify(mSecureSettings).registerContentObserverForUser( verify(mSecureSettings).registerContentObserverForUser( eq(Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED), anyBoolean(), eq(Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED), anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL)); observerCaptor.capture(), eq(UserHandle.USER_ALL)); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +25 −15 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ import androidx.annotation.VisibleForTesting; import com.android.systemui.Dumpable; import com.android.systemui.Dumpable; import com.android.systemui.common.ui.ConfigurationState; import com.android.systemui.common.ui.ConfigurationState; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlagsClassic; import com.android.systemui.flags.FeatureFlagsClassic; Loading Loading @@ -78,6 +79,7 @@ import com.android.systemui.util.settings.SecureSettings; import java.io.PrintWriter; import java.io.PrintWriter; import java.util.Locale; import java.util.Locale; import java.util.concurrent.Executor; import java.util.function.Consumer; import java.util.function.Consumer; import javax.inject.Inject; import javax.inject.Inject; Loading Loading @@ -136,6 +138,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private KeyguardInteractor mKeyguardInteractor; private KeyguardInteractor mKeyguardInteractor; private KeyguardClockInteractor mKeyguardClockInteractor; private KeyguardClockInteractor mKeyguardClockInteractor; private final DelayableExecutor mUiExecutor; private final DelayableExecutor mUiExecutor; private final Executor mBgExecutor; private boolean mCanShowDoubleLineClock = true; private boolean mCanShowDoubleLineClock = true; private DisposableHandle mAodIconsBindHandle; private DisposableHandle mAodIconsBindHandle; @Nullable private NotificationIconContainer mAodIconContainer; @Nullable private NotificationIconContainer mAodIconContainer; Loading Loading @@ -186,6 +189,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS KeyguardUnlockAnimationController keyguardUnlockAnimationController, KeyguardUnlockAnimationController keyguardUnlockAnimationController, SecureSettings secureSettings, SecureSettings secureSettings, @Main DelayableExecutor uiExecutor, @Main DelayableExecutor uiExecutor, @Background Executor bgExecutor, DumpManager dumpManager, DumpManager dumpManager, ClockEventController clockEventController, ClockEventController clockEventController, @KeyguardClockLog LogBuffer logBuffer, @KeyguardClockLog LogBuffer logBuffer, Loading @@ -209,6 +213,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mIconViewBindingFailureTracker = iconViewBindingFailureTracker; mIconViewBindingFailureTracker = iconViewBindingFailureTracker; mSecureSettings = secureSettings; mSecureSettings = secureSettings; mUiExecutor = uiExecutor; mUiExecutor = uiExecutor; mBgExecutor = bgExecutor; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mDumpManager = dumpManager; mDumpManager = dumpManager; mClockEventController = clockEventController; mClockEventController = clockEventController; Loading Loading @@ -328,6 +333,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS updateAodIcons(); updateAodIcons(); mStatusArea = mView.findViewById(R.id.keyguard_status_area); mStatusArea = mView.findViewById(R.id.keyguard_status_area); mBgExecutor.execute(() -> { mSecureSettings.registerContentObserverForUser( mSecureSettings.registerContentObserverForUser( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, false, /* notifyForDescendants */ false, /* notifyForDescendants */ Loading @@ -341,6 +347,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mShowWeatherObserver, mShowWeatherObserver, UserHandle.USER_ALL UserHandle.USER_ALL ); ); }); updateDoubleLineClock(); updateDoubleLineClock(); mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener( mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener( Loading Loading @@ -382,8 +390,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mClockEventController.unregisterListeners(); mClockEventController.unregisterListeners(); setClock(null); setClock(null); mBgExecutor.execute(() -> { mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver); mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver); mSecureSettings.unregisterContentObserver(mShowWeatherObserver); mSecureSettings.unregisterContentObserver(mShowWeatherObserver); }); mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener( mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener( mKeyguardUnlockAnimationListener); mKeyguardUnlockAnimationListener); Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -195,6 +195,7 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase { mKeyguardUnlockAnimationController, mKeyguardUnlockAnimationController, mSecureSettings, mSecureSettings, mExecutor, mExecutor, mExecutor, mDumpManager, mDumpManager, mClockEventController, mClockEventController, mLogBuffer, mLogBuffer, Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -157,6 +157,7 @@ public class KeyguardClockSwitchControllerTest extends KeyguardClockSwitchContro ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor.forClass(ContentObserver.class); ArgumentCaptor.forClass(ContentObserver.class); mController.init(); mController.init(); mExecutor.runAllReady(); verify(mSecureSettings).registerContentObserverForUser( verify(mSecureSettings).registerContentObserverForUser( eq(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK), eq(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK), anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL)); anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL)); Loading Loading @@ -212,6 +213,7 @@ public class KeyguardClockSwitchControllerTest extends KeyguardClockSwitchContro ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor<ContentObserver> observerCaptor = ArgumentCaptor.forClass(ContentObserver.class); ArgumentCaptor.forClass(ContentObserver.class); mController.init(); mController.init(); mExecutor.runAllReady(); verify(mSecureSettings).registerContentObserverForUser( verify(mSecureSettings).registerContentObserverForUser( eq(Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED), anyBoolean(), eq(Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED), anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL)); observerCaptor.capture(), eq(UserHandle.USER_ALL)); Loading