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

Commit 1eaeaf58 authored by Anton Potapov's avatar Anton Potapov
Browse files

Cleanup ScreenCaptureActivity

Remove a bunch of leftover code from ScreenCaptureActivity migration to ScreenCaptureUi window.

Flag: com.android.systemui.new_screen_record_toolbar
Test: manual on foldable
Fixes: 427682447
Change-Id: Ie4bc246aefc03c30204b6236fcb359219ae338e8
parent aa7929f6
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -537,14 +537,6 @@
            android:singleUser="true"
            android:permission="android.permission.LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE" />

        <activity android:name=".screencapture.ui.ScreenCaptureActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:finishOnCloseSystemDialogs="true"
            android:launchMode="singleInstance"
            android:showForAllUsers="true"
            android:theme="@style/ScreenCapture" />

        <activity
            android:name=".screencapture.record.smallscreen.ui.SmallScreenPostRecordingActivity"
            android:excludeFromRecents="true"
+0 −60
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.screencapture.common.shared.model

import android.content.Intent
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.kosmos.runTest
import com.android.systemui.testKosmosNew
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith

@SmallTest
@RunWith(AndroidJUnit4::class)
class ScreenCaptureActivityIntentParametersTest : SysuiTestCase() {

    private val kosmos = testKosmosNew()

    @Test
    fun testCastParameters() =
        kosmos.runTest {
            assertThat(castScreenCaptureActivityIntentParameters.passThroughIntent())
                .isEqualTo(castScreenCaptureActivityIntentParameters)
        }

    @Test
    fun testRecordParameters() =
        kosmos.runTest {
            assertThat(recordScreenCaptureActivityIntentParameters.passThroughIntent())
                .isEqualTo(recordScreenCaptureActivityIntentParameters)
        }

    @Test
    fun testShareParameters() =
        kosmos.runTest {
            assertThat(shareScreenCaptureActivityIntentParameters.passThroughIntent())
                .isEqualTo(shareScreenCaptureActivityIntentParameters)
        }

    private fun ScreenCaptureActivityIntentParameters.passThroughIntent():
        ScreenCaptureActivityIntentParameters {
        return ScreenCaptureActivityIntentParameters.fromIntent(Intent().apply(::fillIntent))
    }
}
+3 −4
Original line number Diff line number Diff line
@@ -65,8 +65,8 @@ import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelect
import com.android.systemui.mediaprojection.devicepolicy.ScreenCaptureDevicePolicyResolver;
import com.android.systemui.mediaprojection.devicepolicy.ScreenCaptureDisabledDialogDelegate;
import com.android.systemui.res.R;
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureActivityIntentParameters;
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureType;
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureUiParameters;
import com.android.systemui.screencapture.domain.interactor.ScreenCaptureUiInteractor;
import com.android.systemui.screencapture.sharescreen.domain.interactor.ScreenCaptureShareScreenFeaturesInteractor;
import com.android.systemui.statusbar.phone.AlertDialogWithDelegate;
@@ -246,9 +246,8 @@ public class MediaProjectionPermissionActivity extends Activity {
    }

    private void showShareScreenUI() {

        final ScreenCaptureActivityIntentParameters params =
                new ScreenCaptureActivityIntentParameters(
        final ScreenCaptureUiParameters params =
                new ScreenCaptureUiParameters(
                        ScreenCaptureType.SHARE_SCREEN,
                        mReviewGrantedConsentRequired,
                        /* resultReceiver= */ null,
+2 −2
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@ import com.android.systemui.qs.logging.QSLogger;
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor;
import com.android.systemui.qs.tileimpl.QSTileImpl;
import com.android.systemui.res.R;
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureActivityIntentParameters;
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureType;
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureUiParameters;
import com.android.systemui.screencapture.domain.interactor.ScreenCaptureUiInteractor;
import com.android.systemui.screencapture.record.domain.interactor.ScreenCaptureRecordFeaturesInteractor;
import com.android.systemui.screenrecord.ScreenRecordUxController;
@@ -135,7 +135,7 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState>
            UserHandle userHandle = UserHandle.of(getCurrentTileUser());
            mActivityStarter.postQSRunnableDismissingKeyguard(
                    () -> mScreenCaptureUiInteractor.show(
                            new ScreenCaptureActivityIntentParameters(
                            new ScreenCaptureUiParameters(
                                    /* screenCaptureType= */ ScreenCaptureType.RECORD,
                                    /* isUserConsentRequired= */ false,
                                    /* resultReceiver= */ null,
+2 −2
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor
import com.android.systemui.qs.tiles.base.domain.interactor.QSTileUserActionInteractor
import com.android.systemui.qs.tiles.base.domain.model.QSTileInput
import com.android.systemui.qs.tiles.base.shared.model.QSTileUserAction
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureActivityIntentParameters
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureType
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureUiParameters
import com.android.systemui.screencapture.domain.interactor.ScreenCaptureUiInteractor
import com.android.systemui.screencapture.record.domain.interactor.ScreenCaptureRecordFeaturesInteractor
import com.android.systemui.screenrecord.ScreenRecordUxController
@@ -67,7 +67,7 @@ constructor(
                        // TODO(b/412723197): pass actual params here.
                        activityStarter.postQSRunnableDismissingKeyguard {
                            screenCaptureUiInteractor.show(
                                ScreenCaptureActivityIntentParameters(
                                ScreenCaptureUiParameters(
                                    ScreenCaptureType.RECORD,
                                    isUserConsentRequired = false,
                                    resultReceiver = null,
Loading