kopia lustrzana https://github.com/olgamiller/SSTVEncoder2
Request permissions only on Android 6.0 or later
rodzic
c08b6e7c4b
commit
bd949f044b
|
@ -158,18 +158,16 @@ public class MainActivity extends AppCompatActivity {
|
|||
&& ((ErrnoException) ex.getCause()).errno == OsConstants.EACCES;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
private boolean needsRequestReadPermission() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
|
||||
return false;
|
||||
String permission = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
int state = ContextCompat.checkSelfPermission(this, permission);
|
||||
return state != PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
private boolean needsRequestWritePermission() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
|
||||
return false;
|
||||
String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
int state = ContextCompat.checkSelfPermission(this, permission);
|
||||
|
|
Ładowanie…
Reference in New Issue