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

Commit e63a3c26 authored by Alec Foster's avatar Alec Foster Committed by Automerger Merge Worker
Browse files

Merge "Revert "Introduce DreamLog using LogBuffer."" into udc-dev am: 2ac9acde am: 8b8c704a

parents 013dcf50 8b8c704a
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.
 */

package com.android.systemui.dreams

import com.android.systemui.log.dagger.DreamLog
import com.android.systemui.plugins.log.LogBuffer
import com.android.systemui.plugins.log.LogLevel
import javax.inject.Inject

/** Logs dream-related stuff to a {@link LogBuffer}. */
class DreamLogger @Inject constructor(@DreamLog private val buffer: LogBuffer) {
    /** Logs a debug message to the buffer. */
    fun d(tag: String, message: String) {
        buffer.log(tag, LogLevel.DEBUG, { str1 = message }, { message })
    }
}
+0 −11
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.animation.AnimatorSet
import android.animation.ValueAnimator
import android.view.View
import android.view.animation.Interpolator
import androidx.core.animation.doOnCancel
import androidx.core.animation.doOnEnd
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
@@ -66,11 +65,7 @@ constructor(
    private val mDreamInTranslationYDistance: Int,
    @Named(DreamOverlayModule.DREAM_IN_TRANSLATION_Y_DURATION)
    private val mDreamInTranslationYDurationMs: Long,
    private val mLogger: DreamLogger,
) {
    companion object {
        private const val TAG = "DreamOverlayAnimationsController"
    }

    private var mAnimator: Animator? = null
    private lateinit var view: View
@@ -174,11 +169,8 @@ constructor(
                doOnEnd {
                    mAnimator = null
                    mOverlayStateController.setEntryAnimationsFinished(true)
                    mLogger.d(TAG, "Dream overlay entry animations finished.")
                }
                doOnCancel { mLogger.d(TAG, "Dream overlay entry animations canceled.") }
                start()
                mLogger.d(TAG, "Dream overlay entry animations started.")
            }
    }

@@ -240,11 +232,8 @@ constructor(
                doOnEnd {
                    mAnimator = null
                    mOverlayStateController.setExitAnimationsRunning(false)
                    mLogger.d(TAG, "Dream overlay exit animations finished.")
                }
                doOnCancel { mLogger.d(TAG, "Dream overlay exit animations canceled.") }
                start()
                mLogger.d(TAG, "Dream overlay exit animations started.")
            }
        mOverlayStateController.setExitAnimationsRunning(true)
        return mAnimator as AnimatorSet
+0 −22
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.
 */

package com.android.systemui.log.dagger

import javax.inject.Qualifier

/** A [com.android.systemui.log.LogBuffer] for dream-related logging. */
@Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class DreamLog
+0 −10
Original line number Diff line number Diff line
@@ -423,14 +423,4 @@ public class LogModule {
    public static LogBuffer provideKeyguardLogBuffer(LogBufferFactory factory) {
        return factory.create("KeyguardLog", 250);
    }

    /**
     * Provides a {@link LogBuffer} for dream-related logs.
     */
    @Provides
    @SysUISingleton
    @DreamLog
    public static LogBuffer provideDreamLogBuffer(LogBufferFactory factory) {
        return factory.create("DreamLog", 250);
    }
}
+0 −2
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ class DreamOverlayAnimationsControllerTest : SysuiTestCase() {
    @Mock private lateinit var stateController: DreamOverlayStateController
    @Mock private lateinit var configController: ConfigurationController
    @Mock private lateinit var transitionViewModel: DreamingToLockscreenTransitionViewModel
    @Mock private lateinit var logger: DreamLogger
    private lateinit var controller: DreamOverlayAnimationsController

    @Before
@@ -68,7 +67,6 @@ class DreamOverlayAnimationsControllerTest : SysuiTestCase() {
                DREAM_IN_COMPLICATIONS_ANIMATION_DURATION,
                DREAM_IN_TRANSLATION_Y_DISTANCE,
                DREAM_IN_TRANSLATION_Y_DURATION,
                logger
            )

        val mockView: View = mock()