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

Commit 6438db22 authored by Alec Foster's avatar Alec Foster Committed by Android (Google) Code Review
Browse files

Revert "Introduce DreamLog using LogBuffer."

This reverts commit 27d90a95.

Reason for revert: DroidMonitor: Potential culprit for Bug 277275821 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ibb05bd3754bc3642abca19ad2795b0ea87742a69
parent 27d90a95
Loading
Loading
Loading
Loading
+0 −30
Original line number Original line 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 Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import android.animation.AnimatorSet
import android.animation.ValueAnimator
import android.animation.ValueAnimator
import android.view.View
import android.view.View
import android.view.animation.Interpolator
import android.view.animation.Interpolator
import androidx.core.animation.doOnCancel
import androidx.core.animation.doOnEnd
import androidx.core.animation.doOnEnd
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.repeatOnLifecycle
@@ -66,11 +65,7 @@ constructor(
    private val mDreamInTranslationYDistance: Int,
    private val mDreamInTranslationYDistance: Int,
    @Named(DreamOverlayModule.DREAM_IN_TRANSLATION_Y_DURATION)
    @Named(DreamOverlayModule.DREAM_IN_TRANSLATION_Y_DURATION)
    private val mDreamInTranslationYDurationMs: Long,
    private val mDreamInTranslationYDurationMs: Long,
    private val mLogger: DreamLogger,
) {
) {
    companion object {
        private const val TAG = "DreamOverlayAnimationsController"
    }


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


@@ -240,11 +232,8 @@ constructor(
                doOnEnd {
                doOnEnd {
                    mAnimator = null
                    mAnimator = null
                    mOverlayStateController.setExitAnimationsRunning(false)
                    mOverlayStateController.setExitAnimationsRunning(false)
                    mLogger.d(TAG, "Dream overlay exit animations finished.")
                }
                }
                doOnCancel { mLogger.d(TAG, "Dream overlay exit animations canceled.") }
                start()
                start()
                mLogger.d(TAG, "Dream overlay exit animations started.")
            }
            }
        mOverlayStateController.setExitAnimationsRunning(true)
        mOverlayStateController.setExitAnimationsRunning(true)
        return mAnimator as AnimatorSet
        return mAnimator as AnimatorSet
+0 −22
Original line number Original line 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 Original line Diff line number Diff line
@@ -423,14 +423,4 @@ public class LogModule {
    public static LogBuffer provideKeyguardLogBuffer(LogBufferFactory factory) {
    public static LogBuffer provideKeyguardLogBuffer(LogBufferFactory factory) {
        return factory.create("KeyguardLog", 250);
        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 Original line Diff line number Diff line
@@ -49,7 +49,6 @@ class DreamOverlayAnimationsControllerTest : SysuiTestCase() {
    @Mock private lateinit var stateController: DreamOverlayStateController
    @Mock private lateinit var stateController: DreamOverlayStateController
    @Mock private lateinit var configController: ConfigurationController
    @Mock private lateinit var configController: ConfigurationController
    @Mock private lateinit var transitionViewModel: DreamingToLockscreenTransitionViewModel
    @Mock private lateinit var transitionViewModel: DreamingToLockscreenTransitionViewModel
    @Mock private lateinit var logger: DreamLogger
    private lateinit var controller: DreamOverlayAnimationsController
    private lateinit var controller: DreamOverlayAnimationsController


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


        val mockView: View = mock()
        val mockView: View = mock()