Merge pull request #22631 from hrydgard/fix-microphone-requirement

Android: Fix microphone requirement
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2026-10-17 19:32:13 +02:00
commit f572831d37
2 files changed
+6

No files matched your search

+1
View File
@@ -16,6 +16,7 @@
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:name="android.hardware.type.pc" android:required="false" />
<!-- I tried using android:maxSdkVersion="29" on WRITE/READ_EXTERNAL_STORAGE, but that made
@@ -1877,6 +1877,11 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList
return true;
} else if (command.equals("microphone_command")) {
if (params.startsWith("startRecording:")) {
// No point asking for permission for a microphone the device doesn't have.
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_MICROPHONE)) {
Log.i(TAG, "No microphone, not starting recording");
return true;
}
int sampleRate = Integer.parseInt(params.replace("startRecording:", ""));
NativeApp.audioRecording_SetSampleRate(sampleRate);
if (!askForPermissions(permissionsForMicrophone, REQUEST_CODE_MICROPHONE_PERMISSION)) {