Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
downgrade to api 29, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
lfuelling committed Nov 11, 2020
1 parent bf406b4 commit 7c9be69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.application'

android {
buildToolsVersion '30.0.2'
compileSdkVersion 30
compileSdkVersion 29
defaultConfig {
applicationId "io.lerk.lrkFM"
minSdkVersion 23
targetSdkVersion 30
versionCode 57
versionName '2.5.0b1'
targetSdkVersion 29
versionCode 58
versionName '2.5.0b2'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
dexOptions {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
Expand All @@ -17,6 +16,7 @@
android:restoreAnyVersion="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true"
tools:ignore="GoogleAppIndexingWarning">

<meta-data
Expand Down
24 changes: 4 additions & 20 deletions app/src/main/java/io/lerk/lrkFM/activities/file/FileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,6 @@ public class FileActivity extends ThemedAppCompatActivity {
*/
private static final String STATE_KEY_OP_CONTEXT_FILES = "state_current_op_files";

/**
* The permissions we need to do our job on Android R and higher.
*/
@RequiresApi(api = Build.VERSION_CODES.R)
private static final String[] PERMISSIONS_STORAGE_R = {
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.MANAGE_EXTERNAL_STORAGE
};

/**
* The permissions we need to do our job.
*/
Expand Down Expand Up @@ -339,7 +329,7 @@ private void extractFromUri(String dataString, @Nullable String targetDir) throw
Log.d(TAG, "Extracting from uri: '" + dataString + "'...");
File tempFile = UriUtil.createTempFileFromUri(this, uri);

if(targetDir == null) {
if (targetDir == null) {
AlertDialog dia = new AlertDialog.Builder(this)
.setView(R.layout.layout_path_prompt_dir)
.setTitle(R.string.extraction_path)
Expand All @@ -361,7 +351,7 @@ private void extractFromUri(String dataString, @Nullable String targetDir) throw

private void doExtractFromUri(File tempFile, String targetPath) {
new ArchiveExtractionTask(this, targetPath, new FMFile(tempFile), success -> {
if(!tempFile.delete() && tempFile.exists()) {
if (!tempFile.delete() && tempFile.exists()) {
Log.w(TAG, "Unable to delete temp file!");
}
clearFileOpCache();
Expand Down Expand Up @@ -1258,14 +1248,8 @@ void newFile(File file) {
* @param context the context
*/
public static void verifyStoragePermissions(Activity context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.MANAGE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context, PERMISSIONS_STORAGE_R, REQUEST_EXTERNAL_STORAGE);
}
} else {
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
}
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
}
}

Expand Down

0 comments on commit 7c9be69

Please sign in to comment.