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

Commit 843cd5ea authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

[DO NOT MERGE] Revert "[DO NOT MERGE]Revert "Migrate KeyguardClockSwitch to new..."

Revert "[DO NOT MERGE]Revert "Expose the clock version of google..."

Revert "[DO NOT MERGE]Revert "Changes to SystemUIGoogle to suppo..."

Revert submission 19508951-revert-19451291-cherrypick-clock_migration-tvip0m638i-BKWSUCNJAV

Reason for revert: Double Revert w/ fixes
Reverted Changes:
Iccd8d2e19:[DO NOT MERGE]Revert "Add clock version of google-...
I432d3d814:[DO NOT MERGE]Revert "Migrate KeyguardClockSwitch ...
Ifd0aa59df:[DO NOT MERGE]Revert "Expose the clock version of ...
I9a6ca6349:[DO NOT MERGE]Revert "Changes to SystemUIGoogle to...

To minimize merge issues, this topic consists of just cherry-picks from
master. Fixes for bugs are provided as downstream commits and will be
merged back to master as those bugs exist there as well. The commits
in this topic weren't tested in isolation beyond automated testing.

Additionally, I've updated the ktfmt exclude list to include new files
from this cherry-pick instead of reformatting those files.

Test: Screenshot test and manually validated each downstream fix mostly by
comparing reference images from known good builds to test builds.

Change-Id: Iff1d0ee8c6d09c77185be1ca5bbbe1aa5870e0c7
parent 7b21fb6b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
-packages/SystemUI/src-release/com/android/systemui/flags/FlagsModule.kt
-packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt
-packages/SystemUI/src/com/android/keyguard/BouncerPanelExpansionCalculator.kt
-packages/SystemUI/src/com/android/keyguard/ClockEventController.kt
-packages/SystemUI/src/com/android/keyguard/KeyguardBiometricLockoutLogger.kt
-packages/SystemUI/src/com/android/keyguard/KeyguardListenModel.kt
-packages/SystemUI/src/com/android/keyguard/KeyguardListenQueue.kt
@@ -156,6 +157,8 @@
-packages/SystemUI/src/com/android/systemui/controls/ui/ToggleRangeBehavior.kt
-packages/SystemUI/src/com/android/systemui/controls/ui/TouchBehavior.kt
-packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
-packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderFactory.kt
-packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderImpl.kt
-packages/SystemUI/src/com/android/systemui/decor/DecorProvider.kt
-packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt
-packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt
@@ -246,6 +249,7 @@
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/ChipStateSender.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipControllerSender.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipRootView.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttSenderLogger.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttSenderUiEventLogger.kt
-packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanel.kt
@@ -575,6 +579,7 @@
-packages/SystemUI/src/com/android/systemui/volume/VolumePanelFactory.kt
-packages/SystemUI/tests/src/com/android/keyguard/ActiveUnlockConfigTest.kt
-packages/SystemUI/tests/src/com/android/keyguard/BouncerPanelExpansionCalculatorTest.kt
-packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
-packages/SystemUI/tests/src/com/android/keyguard/KeyguardBiometricLockoutLoggerTest.kt
-packages/SystemUI/tests/src/com/android/keyguard/KeyguardListenQueueTest.kt
-packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
@@ -633,6 +638,7 @@
-packages/SystemUI/tests/src/com/android/systemui/controls/management/TestControlsRequestDialog.kt
-packages/SystemUI/tests/src/com/android/systemui/controls/ui/ControlViewHolderTest.kt
-packages/SystemUI/tests/src/com/android/systemui/controls/ui/DetailDialogTest.kt
-packages/SystemUI/tests/src/com/android/systemui/decor/CutoutDecorProviderFactoryTest.kt
-packages/SystemUI/tests/src/com/android/systemui/decor/OverlayWindowTest.kt
-packages/SystemUI/tests/src/com/android/systemui/decor/PrivacyDotDecorProviderFactoryTest.kt
-packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerDecorProviderFactoryTest.kt
@@ -720,6 +726,7 @@
-packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordDialogTest.kt
-packages/SystemUI/tests/src/com/android/systemui/screenshot/ImageCaptureImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/screenshot/RequestProcessorTest.kt
-packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotPolicyImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/screenshot/TakeScreenshotServiceTest.kt
-packages/SystemUI/tests/src/com/android/systemui/settings/UserFileManagerImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/settings/UserTrackerImplTest.kt
+13 −8
Original line number Diff line number Diff line
@@ -13,9 +13,9 @@
 */
package com.android.systemui.plugins

import android.content.res.Resources
import android.graphics.drawable.Drawable
import android.view.View
import com.android.internal.colorextraction.ColorExtractor
import com.android.systemui.plugins.annotations.ProvidesInterface
import java.io.PrintWriter
import java.util.Locale
@@ -57,7 +57,15 @@ interface Clock {
    val events: ClockEvents

    /** Triggers for various animations */
    val animation: ClockAnimation
    val animations: ClockAnimations

    /** Initializes various rendering parameters. If never called, provides reasonable defaults. */
    fun initialize(resources: Resources, dozeFraction: Float, foldFraction: Float) {
        events.onColorPaletteChanged(resources)
        animations.doze(dozeFraction)
        animations.fold(foldFraction)
        events.onTimeTick()
    }

    /** Optional method for dumping debug information */
    fun dump(pw: PrintWriter) { }
@@ -80,15 +88,12 @@ interface ClockEvents {
    /** Call whenever font settings change */
    fun onFontSettingChanged() { }

    /** Call whenever the color pallete should update */
    fun onColorPaletteChanged(palette: ColorExtractor.GradientColors) { }
    /** Call whenever the color palette should update */
    fun onColorPaletteChanged(resources: Resources) { }
}

/** Methods which trigger various clock animations */
interface ClockAnimation {
    /** Initializes the doze & fold animation positions. Defaults to neither folded nor dozing. */
    fun initialize(dozeFraction: Float, foldFraction: Float) { }

interface ClockAnimations {
    /** Runs an enter animation (if any) */
    fun enter() { }

+0 −28
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2020, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<!--
** AOD/LockScreen Clock font.
** Should include all numeric glyphs in all supported locales.
** Recommended: font with variable width to support AOD => LS animations
-->
<!-- TODO: Remove when clock migration complete -->
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
    <font android:typeface="monospace"/>
</font-family>
 No newline at end of file
+2 −30
Original line number Diff line number Diff line
@@ -31,42 +31,14 @@
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:paddingStart="@dimen/clock_padding_start">
        <com.android.systemui.shared.clocks.AnimatableClockView
            android:id="@+id/animatable_clock_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:gravity="start"
            android:textSize="@dimen/clock_text_size"
            android:fontFamily="@font/clock"
            android:elegantTextHeight="false"
            android:singleLine="true"
            android:fontFeatureSettings="pnum"
            chargeAnimationDelay="350"
            dozeWeight="200"
            lockScreenWeight="400"
        />
    </FrameLayout>
    <FrameLayout
        android:id="@+id/lockscreen_clock_view_large"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_height="match_parent"
        android:layout_below="@id/keyguard_slice_view"
        android:paddingTop="@dimen/keyguard_large_clock_top_padding"
        android:visibility="gone">
        <com.android.systemui.shared.clocks.AnimatableClockView
            android:id="@+id/animatable_clock_view_large"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center_horizontal"
            android:textSize="@dimen/large_clock_text_size"
            android:fontFamily="@font/clock"
            android:typeface="monospace"
            android:elegantTextHeight="false"
            chargeAnimationDelay="200"
            dozeWeight="200"
            lockScreenWeight="400"
        />
    </FrameLayout>

    <!-- Not quite optimal but needed to translate these items as a group. The
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    android:id="@+id/time_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:fontFamily="@font/clock"
    android:fontFamily="@*android:string/config_clockFontFamily"
    android:textColor="@android:color/white"
    android:format12Hour="@string/dream_time_complication_12_hr_time_format"
    android:format24Hour="@string/dream_time_complication_24_hr_time_format"
Loading