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

Commit a45d8065 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB] Remove flag status_bar_auto_start_screen_record_chip

Flag launched awhile ago, so we can remove it.

Fixes: 409611072
Bug: 366448907
Flag: EXEMPT flag removal

Test: atest ScreenRecordChipInteractorTest
Test: verify screen record chip still works
Change-Id: Ib06c83a0f9bd4300eef8f7089e45a1af1b1d15d9
parent 2b4f5428
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -435,18 +435,6 @@ flag {
    }
}

flag {
    name: "status_bar_auto_start_screen_record_chip"
    namespace: "systemui"
    description: "When screen recording, use the specified start time to update the screen record "
        "chip state instead of waiting for an official 'recording started' signal"
    bug: "366448907"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}


flag {
    name: "status_bar_chips_modernization"
    namespace: "systemui"
+1 −26
Original line number Diff line number Diff line
@@ -16,11 +16,8 @@

package com.android.systemui.statusbar.chips.screenrecord.domain.interactor

import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.Flags.FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testScope
@@ -161,25 +158,7 @@ class ScreenRecordChipInteractorTest : SysuiTestCase() {
        }

    @Test
    @DisableFlags(FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP)
    fun screenRecordState_flagOff_doesNotAutomaticallySwitchToRecordingBasedOnTime() =
        testScope.runTest {
            val latest by collectLastValue(underTest.screenRecordState)

            // WHEN screen record should start in 900ms
            screenRecordRepo.screenRecordState.value = ScreenRecordModel.Starting(900)
            assertThat(latest).isEqualTo(ScreenRecordChipModel.Starting(900))

            // WHEN 900ms has elapsed
            advanceTimeBy(901)

            // THEN we don't automatically update to the recording state if the flag is off
            assertThat(latest).isEqualTo(ScreenRecordChipModel.Starting(900))
        }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP)
    fun screenRecordState_flagOn_automaticallySwitchesToRecordingBasedOnTime() =
    fun screenRecordState_automaticallySwitchesToRecordingBasedOnTime() =
        testScope.runTest {
            val latest by collectLastValue(underTest.screenRecordState)

@@ -195,7 +174,6 @@ class ScreenRecordChipInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP)
    fun screenRecordState_recordingBeginsEarly_switchesToRecording() =
        testScope.runTest {
            val latest by collectLastValue(underTest.screenRecordState)
@@ -227,7 +205,6 @@ class ScreenRecordChipInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP)
    fun screenRecordState_secondRecording_doesNotAutomaticallyStart() =
        testScope.runTest {
            val latest by collectLastValue(underTest.screenRecordState)
@@ -250,7 +227,6 @@ class ScreenRecordChipInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP)
    fun screenRecordState_startingButThenDoingNothing_doesNotAutomaticallyStart() =
        testScope.runTest {
            val latest by collectLastValue(underTest.screenRecordState)
@@ -269,7 +245,6 @@ class ScreenRecordChipInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_AUTO_START_SCREEN_RECORD_CHIP)
    fun screenRecordState_multipleStartingValues_autoStartResets() =
        testScope.runTest {
            val latest by collectLastValue(underTest.screenRecordState)
+1 −6
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.statusbar.chips.screenrecord.domain.interactor

import android.media.projection.StopReason
import com.android.systemui.Flags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.log.LogBuffer
@@ -85,11 +84,7 @@ constructor(
                mediaProjectionRepository.mediaProjectionState,
                shouldAssumeIsRecording,
            ) { screenRecordState, mediaProjectionState, shouldAssumeIsRecording ->
                if (
                    Flags.statusBarAutoStartScreenRecordChip() &&
                        shouldAssumeIsRecording &&
                        screenRecordState is ScreenRecordModel.Starting
                ) {
                if (shouldAssumeIsRecording && screenRecordState is ScreenRecordModel.Starting) {
                    logger.log(
                        TAG,
                        LogLevel.INFO,