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

Commit 5bff7692 authored by Anton Potapov's avatar Anton Potapov
Browse files

Add camera toggle

Flag: com.android.systemui.new_screen_record_toolbar
Bug: 441486122
Test: manual on foldable: check that the new toggle is working
Change-Id: Ib63bcbed49b5c3bbc1452ace772a02108bd7ca27
parent a2451af1
Loading
Loading
Loading
Loading
+25 −0
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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="22dp"
    android:viewportWidth="20"
    android:viewportHeight="22">
  <path
      android:pathData="M4.65,7.15C4.75,7.25 4.867,7.3 5,7.3C5.133,7.3 5.25,7.25 5.35,7.15L6.65,5.85C6.75,5.75 6.8,5.633 6.8,5.5C6.8,5.367 6.75,5.25 6.65,5.15L5.35,3.85C5.25,3.75 5.133,3.7 5,3.7C4.867,3.7 4.75,3.75 4.65,3.85L3.35,5.15C3.25,5.25 3.2,5.367 3.2,5.5C3.2,5.633 3.25,5.75 3.35,5.85L4.65,7.15ZM2,13C1.45,13 0.975,12.808 0.575,12.425C0.192,12.025 0,11.55 0,11V2C0,1.45 0.192,0.983 0.575,0.6C0.975,0.2 1.45,-0 2,-0H18C18.55,-0 19.017,0.2 19.4,0.6C19.8,0.983 20,1.45 20,2V11C20,11.55 19.8,12.025 19.4,12.425C19.017,12.808 18.55,13 18,13H15.975C15.692,13 15.458,12.908 15.275,12.725C15.092,12.525 15,12.283 15,12C15,11.717 15.092,11.483 15.275,11.3C15.475,11.1 15.717,11 16,11H18V2H2V11H4C4.283,11 4.517,11.1 4.7,11.3C4.9,11.483 5,11.717 5,12C5,12.283 4.9,12.525 4.7,12.725C4.517,12.908 4.283,13 4,13H2ZM14.5,6C14.917,6 15.267,5.858 15.55,5.575C15.85,5.275 16,4.917 16,4.5C16,4.083 15.85,3.733 15.55,3.45C15.267,3.15 14.917,3 14.5,3C14.083,3 13.725,3.15 13.425,3.45C13.142,3.733 13,4.083 13,4.5C13,4.917 13.142,5.275 13.425,5.575C13.725,5.858 14.083,6 14.5,6ZM4,22C3.717,22 3.475,21.908 3.275,21.725C3.092,21.525 3,21.283 3,21V19.9C3,19.317 3.158,18.775 3.475,18.275C3.808,17.775 4.242,17.4 4.775,17.15C5.592,16.767 6.442,16.483 7.325,16.3C8.208,16.1 9.1,16 10,16C10.9,16 11.792,16.1 12.675,16.3C13.558,16.483 14.408,16.767 15.225,17.15C15.758,17.4 16.183,17.775 16.5,18.275C16.833,18.775 17,19.317 17,19.9V21C17,21.283 16.9,21.525 16.7,21.725C16.517,21.908 16.283,22 16,22H4ZM5,20H15V19.9C15,19.7 14.942,19.517 14.825,19.35C14.708,19.183 14.558,19.058 14.375,18.975C13.675,18.658 12.958,18.417 12.225,18.25C11.492,18.083 10.75,18 10,18C9.25,18 8.508,18.083 7.775,18.25C7.042,18.417 6.325,18.658 5.625,18.975C5.442,19.058 5.292,19.183 5.175,19.35C5.058,19.517 5,19.7 5,19.9V20ZM10,15C9.033,15 8.208,14.658 7.525,13.975C6.842,13.292 6.5,12.467 6.5,11.5C6.5,10.533 6.842,9.708 7.525,9.025C8.208,8.342 9.033,8 10,8C10.967,8 11.792,8.342 12.475,9.025C13.158,9.708 13.5,10.533 13.5,11.5C13.5,12.467 13.158,13.292 12.475,13.975C11.792,14.658 10.967,15 10,15ZM10,13C10.417,13 10.767,12.858 11.05,12.575C11.35,12.275 11.5,11.917 11.5,11.5C11.5,11.083 11.35,10.733 11.05,10.45C10.767,10.15 10.417,10 10,10C9.583,10 9.225,10.15 8.925,10.45C8.642,10.733 8.5,11.083 8.5,11.5C8.5,11.917 8.642,12.275 8.925,12.575C9.225,12.858 9.583,13 10,13Z"
      android:fillColor="#ffffff"/>
</vector>
+2 −0
Original line number Diff line number Diff line
@@ -352,6 +352,8 @@
    <string name="screen_record_record_device_audio_label">Record device audio</string>
    <!-- Screen recording should record microphone setting [CHAR LIMIT=35] -->
    <string name="screen_record_record_microphone_label">Record microphone</string>
    <!-- Screen recording should show selfie camera [CHAR LIMIT=35] -->
    <string name="screen_record_should_show_camera_label">Show selfie camera</string>
    <!-- Screen recording should show touches setting [CHAR LIMIT=35] -->
    <string name="screen_record_should_show_touches_label">Show touches</string>
    <!-- Header for the carousel to choose an app for screen recording. [CHAR LIMIT=50] -->
+3 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.systemui.screencapture.record.data.repository

import android.view.Display
import com.android.systemui.screencapture.common.ScreenCaptureUi
import com.android.systemui.screencapture.common.ScreenCaptureUiScope
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureTarget
import com.android.systemui.screencapture.record.shared.model.ScreenCaptureRecordParametersModel
import com.android.systemui.screenrecord.ScreenRecordingAudioSource
@@ -26,7 +26,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update

@ScreenCaptureUi
@ScreenCaptureUiScope
class ScreenCaptureRecordParametersRepository @Inject constructor() {

    private val _parameters =
@@ -35,6 +35,7 @@ class ScreenCaptureRecordParametersRepository @Inject constructor() {
                target = ScreenCaptureTarget.Fullscreen(Display.DEFAULT_DISPLAY),
                audioSource = ScreenRecordingAudioSource.NONE,
                shouldShowTaps = false,
                shouldShowFrontCamera = false,
            )
        )
    val parameters = _parameters.asStateFlow()
+6 −2
Original line number Diff line number Diff line
@@ -16,13 +16,13 @@

package com.android.systemui.screencapture.record.domain.interactor

import com.android.systemui.screencapture.common.ScreenCaptureUi
import com.android.systemui.screencapture.common.ScreenCaptureUiScope
import com.android.systemui.screencapture.common.shared.model.ScreenCaptureTarget
import com.android.systemui.screencapture.record.data.repository.ScreenCaptureRecordParametersRepository
import com.android.systemui.screenrecord.ScreenRecordingAudioSource
import javax.inject.Inject

@ScreenCaptureUi
@ScreenCaptureUiScope
class ScreenCaptureRecordParametersInteractor
@Inject
constructor(private val repository: ScreenCaptureRecordParametersRepository) {
@@ -40,4 +40,8 @@ constructor(private val repository: ScreenCaptureRecordParametersRepository) {
    fun setShouldShowTaps(shouldShowTaps: Boolean) {
        repository.updateParameters { it.copy(shouldShowTaps = shouldShowTaps) }
    }

    fun setShouldShowFrontCamera(shouldShowFrontCamera: Boolean) {
        repository.updateParameters { it.copy(shouldShowFrontCamera = shouldShowFrontCamera) }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -24,4 +24,5 @@ data class ScreenCaptureRecordParametersModel(
    val target: ScreenCaptureTarget,
    val audioSource: ScreenRecordingAudioSource,
    val shouldShowTaps: Boolean,
    val shouldShowFrontCamera: Boolean,
)
Loading