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

Commit 044291d8 authored by Michael W's avatar Michael W
Browse files

Recorder: Remove deprecated constuctor

* The build targets are sdk levels 34 and 35, S is 31 and thus we don't
  need to support anything below anymore
* Bump the minSdk as well to reflect that

Change-Id: If1ed970ba1ce28a77a737bf719b4fb9ef64d4fdc
parent b48a4281
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ android {

    defaultConfig {
        applicationId = "org.lineageos.recorder"
        minSdk = 29
        minSdk = 31
        targetSdk = 35
        versionCode = 1
        versionName = "1.1"
+2 −8
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2021-2024 The LineageOS Project
 * SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
 * SPDX-License-Identifier: Apache-2.0
 */

@@ -8,7 +8,6 @@ package org.lineageos.recorder.service
import android.Manifest.permission
import android.content.Context
import android.media.MediaRecorder
import android.os.Build
import androidx.annotation.RequiresPermission
import java.io.File
import java.io.IOException
@@ -20,12 +19,7 @@ class GoodQualityRecorder(private val context: Context) : SoundRecording {
    @RequiresPermission(permission.RECORD_AUDIO)
    @Throws(IOException::class)
    override fun startRecording(file: File) {
        recorder = (if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
            MediaRecorder(context)
        } else {
            @Suppress("Deprecation")
            MediaRecorder()
        }).apply {
        recorder = MediaRecorder(context).apply {
            setOutputFile(file)
            setAudioSource(MediaRecorder.AudioSource.DEFAULT)
            setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)