Loading packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionContentManager.kt +27 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ import android.app.Activity import android.app.PendingIntent import android.content.Intent import android.hardware.display.DisplayManager import android.media.MediaCodecInfo import android.media.MediaCodecList import android.media.MediaFormat import android.os.Build import android.os.Bundle import android.os.Handler Loading Loading @@ -186,6 +189,12 @@ class ScreenRecordPermissionContentManager( audioSwitch.isChecked = true } // Disable HEVC when hardware accelerated codec is not available if (!hasHevcHwEncoder()) { Prefs.putInt(userContextProvider.userContext, PREF_HEVC, 0) containerView.requireViewById<View>(R.id.show_hevc).visibility = View.GONE } // disable redundant Touch & Hold accessibility action for Switch Access options.accessibilityDelegate = object : View.AccessibilityDelegate() { Loading Loading @@ -257,6 +266,24 @@ class ScreenRecordPermissionContentManager( INTERVAL_MS, startIntent, stopIntent) } private fun hasHevcHwEncoder(): Boolean { val mediaCodecList = MediaCodecList(MediaCodecList.REGULAR_CODECS) for (codecInfo in mediaCodecList.getCodecInfos()) { if (!codecInfo.isEncoder() || !codecInfo.isHardwareAccelerated()) { continue } for (type in codecInfo.getSupportedTypes()) { if (type.equals(MediaFormat.MIMETYPE_VIDEO_HEVC, ignoreCase = true)) { return true } } } return false } private inner class CaptureTargetResultReceiver : ResultReceiver(Handler(Looper.getMainLooper())) { override fun onReceiveResult(resultCode: Int, resultData: Bundle) { Loading Loading
packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionContentManager.kt +27 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ import android.app.Activity import android.app.PendingIntent import android.content.Intent import android.hardware.display.DisplayManager import android.media.MediaCodecInfo import android.media.MediaCodecList import android.media.MediaFormat import android.os.Build import android.os.Bundle import android.os.Handler Loading Loading @@ -186,6 +189,12 @@ class ScreenRecordPermissionContentManager( audioSwitch.isChecked = true } // Disable HEVC when hardware accelerated codec is not available if (!hasHevcHwEncoder()) { Prefs.putInt(userContextProvider.userContext, PREF_HEVC, 0) containerView.requireViewById<View>(R.id.show_hevc).visibility = View.GONE } // disable redundant Touch & Hold accessibility action for Switch Access options.accessibilityDelegate = object : View.AccessibilityDelegate() { Loading Loading @@ -257,6 +266,24 @@ class ScreenRecordPermissionContentManager( INTERVAL_MS, startIntent, stopIntent) } private fun hasHevcHwEncoder(): Boolean { val mediaCodecList = MediaCodecList(MediaCodecList.REGULAR_CODECS) for (codecInfo in mediaCodecList.getCodecInfos()) { if (!codecInfo.isEncoder() || !codecInfo.isHardwareAccelerated()) { continue } for (type in codecInfo.getSupportedTypes()) { if (type.equals(MediaFormat.MIMETYPE_VIDEO_HEVC, ignoreCase = true)) { return true } } } return false } private inner class CaptureTargetResultReceiver : ResultReceiver(Handler(Looper.getMainLooper())) { override fun onReceiveResult(resultCode: Int, resultData: Bundle) { Loading