From 31251f0214b6d37a9407975a23dbdd43e3cad611 Mon Sep 17 00:00:00 2001 From: Tim Schneeberger Date: Fri, 26 May 2023 20:07:51 +0200 Subject: [PATCH] feat(remove-screen-capture-restriction): remove app constraint (#411) Co-authored-by: oSumAtrIX --- .../RemoveScreencaptureRestrictionPatch.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/src/main/java/app/revanced/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch.java diff --git a/app/src/main/java/app/revanced/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch.java b/app/src/main/java/app/revanced/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch.java new file mode 100644 index 00000000..7cfa5acd --- /dev/null +++ b/app/src/main/java/app/revanced/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch.java @@ -0,0 +1,21 @@ +package app.revanced.all.screencapture.removerestriction; + +import android.media.AudioAttributes; +import android.os.Build; + +import androidx.annotation.RequiresApi; + +public final class RemoveScreencaptureRestrictionPatch { + // Member of AudioAttributes.Builder + @RequiresApi(api = Build.VERSION_CODES.Q) + public static AudioAttributes.Builder setAllowedCapturePolicy(final AudioAttributes.Builder builder, final int capturePolicy) { + builder.setAllowedCapturePolicy(AudioAttributes.ALLOW_CAPTURE_BY_ALL); + + return builder; + } + + // Member of AudioManager static class + public static void setAllowedCapturePolicy(final int capturePolicy) { + // Ignore request + } +}