Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41b8da97 authored by Bharath's avatar Bharath Committed by Matt Pietal
Browse files

Add support to configure double line clock in lockscreen [1/2]



Add an override that can be used to configure the default state
of double line clock in lock screen.

Co-authored-by: default avatarLuca Weiss <luca.weiss@fairphone.com>
Bug: 277244307
Test: atest KeyguardClockSwitchControllerTest
(cherry picked from https://android-review.googlesource.com/q/commit:1e802e87fcd1ecbb46d6227988c0b24e0b2b4016

)
Merged-In: I35d5b2807befe253ba327690fdcbc39af3bcfb37
Change-Id: I35d5b2807befe253ba327690fdcbc39af3bcfb37

NOTE FOR REVIEWERS - errors occurred while applying the patch.
PLEASE REVIEW CAREFULLY.
Errors:
Error applying patch in packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java, hunk HunkHeader[149,6->149,9]: Hunk cannot be applied

Original patch:
 From 1e802e87fcd1ecbb46d6227988c0b24e0b2b4016 Mon Sep 17 00:00:00 2001
From: Bharath <bharath@fairphone.com>
Date: Fri, 18 Aug 2023 09:55:00 +0530
Subject: [PATCH] Add support to configure double line clock in lockscreen [1/2]

Add an override that can be used to configure the default state
of double line clock in lock screen.

Co-authored-by: default avatarLuca Weiss <luca.weiss@fairphone.com>
Bug: 277244307
Test: atest KeyguardClockSwitchControllerTest
Change-Id: I35d5b2807befe253ba327690fdcbc39af3bcfb37
---
parent 3710ce6e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1424,6 +1424,11 @@
    <!-- Is the lock-screen disabled for new users by default -->
    <bool name="config_disableLockscreenByDefault">false</bool>

    <!-- Provides default value for double line clock in lock screen setting:
         0 - Don't show double line clock
         1 - Show double line clock in lock screen (default) -->
    <integer name="config_doublelineClockDefault">1</integer>

    <!-- If true, enables verification of the lockscreen credential in the factory reset protection
        flow. This should be true if gatekeeper / weaver credentials can still be checked after a
        factory reset. -->
+3 −0
Original line number Diff line number Diff line
@@ -2355,6 +2355,9 @@
  <java-symbol type="dimen" name="popup_enter_animation_from_y_delta" />
  <java-symbol type="dimen" name="popup_exit_animation_to_y_delta" />

  <!-- For double line clock in lock screen -->
  <java-symbol type="integer" name="config_doublelineClockDefault"/>

  <!-- ImfTest -->
  <java-symbol type="layout" name="auto_complete_list" />

+2 −1
Original line number Diff line number Diff line
@@ -545,7 +545,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS

    private void updateDoubleLineClock() {
        mCanShowDoubleLineClock = mSecureSettings.getIntForUser(
            Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1,
            Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, mView.getResources()
                .getInteger(com.android.internal.R.integer.config_doublelineClockDefault),
                UserHandle.USER_CURRENT) != 0;

        if (!mCanShowDoubleLineClock) {
+2 −0
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase {
                .thenReturn(100);
        when(mResources.getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin))
                .thenReturn(-200);
        when(mResources.getInteger(com.android.internal.R.integer.config_doublelineClockDefault))
                .thenReturn(1);
        when(mResources.getInteger(R.integer.keyguard_date_weather_view_invisibility))
                .thenReturn(INVISIBLE);

+1 −0
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@ public class KeyguardClockSwitchControllerTest extends KeyguardClockSwitchContro

        // When a settings change has occurred to the small clock, make sure the view is adjusted
        reset(mView);
        when(mView.getResources()).thenReturn(mResources);
        observer.onChange(true);
        mExecutor.runAllReady();
        verify(mView).switchToClock(KeyguardClockSwitch.SMALL, /* animate */ true);