diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2022-09-27 07:54:10 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 07:54:10 +1000 |
commit | bb1a8bf464de760d9d1377ae6967008fb16e446b (patch) | |
tree | b10aad3fa2665491a5460eb9742b35de157a29a0 /tools | |
parent | b5c4205c169aaf2ffe8de5419240da8678d9416c (diff) | |
parent | 9f9e9c2bfc4296e879f2431ebc341b5386881974 (diff) |
Merge pull request #21923 from joseluismarti/record_audio_request
[Android] Restore the RECORD_AUDIO permission request
Diffstat (limited to 'tools')
-rw-r--r-- | tools/android/packaging/xbmc/src/Splash.java.in | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in index 61e6c943ed..128e49ae7d 100644 --- a/tools/android/packaging/xbmc/src/Splash.java.in +++ b/tools/android/packaging/xbmc/src/Splash.java.in @@ -65,12 +65,14 @@ public class Splash extends Activity private static final int CheckingPermissionsDone = 10; private static final int CheckingPermissionsInfo = 11; private static final int CheckExternalStorage = 12; + private static final int RecordAudioPermission = 13; private static final int DownloadingObb = 90; private static final int DownloadObbDone = 91; private static final int StartingXBMC = 99; private static final String TAG = "@APP_NAME@"; + private static final int RECORDAUDIO_RESULT_CODE = 8946; private static final int PERMISSION_RESULT_CODE = 8947; private String mCpuinfo = ""; @@ -127,15 +129,19 @@ public class Splash extends Activity @Override public void onClick(DialogInterface dialog, int which) { - mStateMachine.sendEmptyMessage(CheckingPermissions); + mStateMachine.sendEmptyMessage(RecordAudioPermission); } }); dialog.show(); break; - case CheckingPermissions: + case RecordAudioPermission: mSplash.mTextView.setText("Asking for permissions..."); mSplash.mProgress.setVisibility(View.INVISIBLE); + requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, + RECORDAUDIO_RESULT_CODE); + break; + case CheckingPermissions: if ((Build.VERSION.SDK_INT >= 30) && !isAndroidTV()) { try @@ -786,9 +792,14 @@ public class Splash extends Activity { mPermissionOK = true; } + mStateMachine.sendEmptyMessage(CheckingPermissionsDone); + break; + } + case RECORDAUDIO_RESULT_CODE: + { + mStateMachine.sendEmptyMessage(CheckingPermissions); } } - mStateMachine.sendEmptyMessage(CheckingPermissionsDone); } @Override |