mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Revert "Remove unnecessary request for External Storage"
This commit is contained in:
parent
1b73e6c30b
commit
63707a5b77
2 changed files with 10 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
<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.camera" android:required="false" />
|
||||||
<uses-feature android:name="android.hardware.microphone" android:required="false" />
|
<uses-feature android:name="android.hardware.microphone" android:required="false" />
|
||||||
|
|
|
@ -183,9 +183,11 @@ public class ScratchJrActivity
|
||||||
public void requestPermissions() {
|
public void requestPermissions() {
|
||||||
cameraPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
|
cameraPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
|
||||||
micPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);
|
micPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);
|
||||||
|
readExtPermissionResult = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
|
|
||||||
if (cameraPermissionResult == PackageManager.PERMISSION_GRANTED
|
if (cameraPermissionResult == PackageManager.PERMISSION_GRANTED
|
||||||
&& micPermissionResult == PackageManager.PERMISSION_GRANTED) {
|
&& micPermissionResult == PackageManager.PERMISSION_GRANTED
|
||||||
|
&& readExtPermissionResult == PackageManager.PERMISSION_GRANTED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,6 +198,9 @@ public class ScratchJrActivity
|
||||||
if (micPermissionResult != PackageManager.PERMISSION_GRANTED) {
|
if (micPermissionResult != PackageManager.PERMISSION_GRANTED) {
|
||||||
tmp.add(Manifest.permission.RECORD_AUDIO);
|
tmp.add(Manifest.permission.RECORD_AUDIO);
|
||||||
}
|
}
|
||||||
|
if (readExtPermissionResult != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
tmp.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
|
}
|
||||||
Object[] tmpArray = tmp.toArray();
|
Object[] tmpArray = tmp.toArray();
|
||||||
String[] desiredPermissions = Arrays.copyOf(tmpArray, tmpArray.length, String[].class);
|
String[] desiredPermissions = Arrays.copyOf(tmpArray, tmpArray.length, String[].class);
|
||||||
|
|
||||||
|
@ -216,6 +221,9 @@ public class ScratchJrActivity
|
||||||
if (permission.equals(Manifest.permission.RECORD_AUDIO)) {
|
if (permission.equals(Manifest.permission.RECORD_AUDIO)) {
|
||||||
micPermissionResult = grantResults[permissionId];
|
micPermissionResult = grantResults[permissionId];
|
||||||
}
|
}
|
||||||
|
if (permission.equals(Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||||
|
readExtPermissionResult = grantResults[permissionId];
|
||||||
|
}
|
||||||
permissionId++;
|
permissionId++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue