Merge pull request #486 from LLK/remove-external-storage

Remove unnecessary request for External Storage
This commit is contained in:
chrisgarrity 2021-08-11 12:31:30 -04:00 committed by GitHub
commit 2a40e17247
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 10 deletions

View file

@ -6,7 +6,6 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />

View file

@ -183,11 +183,9 @@ public class ScratchJrActivity
public void requestPermissions() {
cameraPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
micPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);
readExtPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
if (cameraPermissionResult == PackageManager.PERMISSION_GRANTED
&& micPermissionResult == PackageManager.PERMISSION_GRANTED
&& readExtPermissionResult == PackageManager.PERMISSION_GRANTED) {
&& micPermissionResult == PackageManager.PERMISSION_GRANTED) {
return;
}
@ -198,9 +196,6 @@ public class ScratchJrActivity
if (micPermissionResult != PackageManager.PERMISSION_GRANTED) {
tmp.add(Manifest.permission.RECORD_AUDIO);
}
if (readExtPermissionResult != PackageManager.PERMISSION_GRANTED) {
tmp.add(Manifest.permission.READ_EXTERNAL_STORAGE);
}
Object[] tmpArray = tmp.toArray();
String[] desiredPermissions = Arrays.copyOf(tmpArray, tmpArray.length, String[].class);
@ -221,9 +216,6 @@ public class ScratchJrActivity
if (permission.equals(Manifest.permission.RECORD_AUDIO)) {
micPermissionResult = grantResults[permissionId];
}
if (permission.equals(Manifest.permission.READ_EXTERNAL_STORAGE)) {
readExtPermissionResult = grantResults[permissionId];
}
permissionId++;
}
}