mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-20 09:49:03 +02:00
Merge pull request #22631 from hrydgard/fix-microphone-requirement
Android: Fix microphone requirement
This commit is contained in:
2 files changed
+6
No files matched your search
@@ -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)) {
|
||||
|
||||
Reference in new issue
Block a user