From 8e19ddcc996396ef93be9f2b0584643507928d2c Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 29 Aug 2023 09:54:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9Android13=20=E8=BF=9E?= =?UTF-8?q?=E9=BA=A6=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/views/LivePlayRyViewHolder.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index ec5cf1155..1107de3b5 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -7,6 +7,7 @@ import android.app.Dialog; import android.content.Context; import android.graphics.Color; import android.media.AudioManager; +import android.os.Build; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; @@ -696,11 +697,20 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { .setClickCallback(new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { - LiveAudienceActivity.mProcessResultUtil.requestPermissions(new String[]{ - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.WRITE_EXTERNAL_STORAGE, - Manifest.permission.RECORD_AUDIO - }, new Runnable() { + String[] permissions; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + permissions=new String[]{ + Manifest.permission.READ_MEDIA_IMAGES, + Manifest.permission.RECORD_AUDIO + }; + }else{ + permissions=new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE, + Manifest.permission.RECORD_AUDIO + }; + } + LiveAudienceActivity.mProcessResultUtil.requestPermissions(permissions, new Runnable() { @Override public void run() { UsertoRY();