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

Commit 9ee895ef authored by Anton Potapov's avatar Anton Potapov
Browse files

Rename ScreenCaptureScope to ScreenCaptureUiScope

The chain starting with this change reworks ScreenCapture scope to
ScreenCaptureUi scope and reintroduces the former back. The difference
would be that ScreenCaptureUi lives when the UI is visible and
ScreenCapture lives when the capture is in progress. This gives us a
neat place to store the data necessary throughout the whole screen
capture, not just at the UI.

Flag: com.android.systemui.new_screen_record_toolbar
Bug: 427682447
Test: passes presubmits
Change-Id: I3960255d525e98ac7165f000cdbfe968072cc714
parent 5a09505f
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -17,16 +17,16 @@
package com.android.systemui.screencapture.cast

import com.android.systemui.screencapture.common.CommonModule
import com.android.systemui.screencapture.common.ScreenCaptureComponent
import com.android.systemui.screencapture.common.ScreenCaptureScope
import com.android.systemui.screencapture.common.ScreenCaptureUiComponent
import com.android.systemui.screencapture.common.ScreenCaptureUiScope
import dagger.Subcomponent

/** Dagger subcomponent for Casting. */
@ScreenCaptureScope
@ScreenCaptureUiScope
@Subcomponent(modules = [CastModule::class, CommonModule::class])
interface ScreenCaptureCastComponent : ScreenCaptureComponent {
interface ScreenCaptureCastUiComponent : ScreenCaptureUiComponent {
    @Subcomponent.Builder
    interface Builder : ScreenCaptureComponent.Builder {
        override fun build(): ScreenCaptureCastComponent
    interface Builder : ScreenCaptureUiComponent.Builder {
        override fun build(): ScreenCaptureCastUiComponent
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ import dagger.Module
import dagger.Provides

/**
 * Dagger Module for bindings common to all [ScreenCaptureComponent]s.
 * Dagger Module for bindings common to all [ScreenCaptureUiComponent]s.
 *
 * This module must be included in the Subcomponent or replaced with equivalent bindings.
 */
@@ -74,7 +74,7 @@ interface CommonModule {

    companion object {
        @Provides
        @ScreenCapture
        @ScreenCaptureUi
        fun provideIconFactory(context: Context): IconFactory = IconFactory.obtain(context)
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import dagger.Module
import dagger.Provides

/**
 * Dagger Module for default bindings expected to be provided by [ScreenCaptureComponent]
 * Dagger Module for default bindings expected to be provided by [ScreenCaptureUiComponent]
 * implementation.
 */
@Module
+4 −1
Original line number Diff line number Diff line
@@ -19,4 +19,7 @@ package com.android.systemui.screencapture.common
import javax.inject.Qualifier

/** Used to qualify an item as the one used by Screen Capture. */
@Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class ScreenCapture
@Qualifier
@MustBeDocumented
@Retention(AnnotationRetention.RUNTIME)
annotation class ScreenCaptureUi
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ package com.android.systemui.screencapture.common

import javax.inject.Scope

/** Scope annotation for Screen Capture scoped items within the [ScreenCaptureComponent]. */
/** Scope annotation for Screen Capture scoped items within the [ScreenCaptureUiComponent]. */
@Scope
@MustBeDocumented
@Retention(AnnotationRetention.RUNTIME)
annotation class ScreenCaptureScope
annotation class ScreenCaptureUiScope
Loading