diff options
author | rubenwardy <rw@rubenwardy.com> | 2021-11-27 00:10:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-27 00:10:13 +0000 |
commit | 51cfb57b4da8e71e39380bf5bf3e19414c779e12 (patch) | |
tree | 5ba84131a1cb3d3795fe62bb58f20bf50db7d396 /android/app/src/main/java/net/minetest | |
parent | 413be76c63309266d3d271f01cc74385067d7263 (diff) | |
download | minetest-51cfb57b4da8e71e39380bf5bf3e19414c779e12.tar.gz minetest-51cfb57b4da8e71e39380bf5bf3e19414c779e12.tar.bz2 minetest-51cfb57b4da8e71e39380bf5bf3e19414c779e12.zip |
Update to Android target SDK 30 (#11746)
Diffstat (limited to 'android/app/src/main/java/net/minetest')
-rw-r--r-- | android/app/src/main/java/net/minetest/minetest/MainActivity.java | 3 | ||||
-rw-r--r-- | android/app/src/main/java/net/minetest/minetest/UnzipService.java | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/android/app/src/main/java/net/minetest/minetest/MainActivity.java b/android/app/src/main/java/net/minetest/minetest/MainActivity.java index 56615fca7..b6567b4b7 100644 --- a/android/app/src/main/java/net/minetest/minetest/MainActivity.java +++ b/android/app/src/main/java/net/minetest/minetest/MainActivity.java @@ -101,7 +101,8 @@ public class MainActivity extends AppCompatActivity { mTextView = findViewById(R.id.textView); sharedPreferences = getSharedPreferences(SETTINGS, Context.MODE_PRIVATE); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && + Build.VERSION.SDK_INT < Build.VERSION_CODES.R) checkPermission(); else checkAppVersion(); diff --git a/android/app/src/main/java/net/minetest/minetest/UnzipService.java b/android/app/src/main/java/net/minetest/minetest/UnzipService.java index b513a7fe0..a61a49139 100644 --- a/android/app/src/main/java/net/minetest/minetest/UnzipService.java +++ b/android/app/src/main/java/net/minetest/minetest/UnzipService.java @@ -32,6 +32,7 @@ import android.os.Environment; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import androidx.annotation.StringRes; import java.io.File; @@ -200,6 +201,10 @@ public class UnzipService extends IntentService { * Migrates user data from deprecated external storage to app scoped storage */ private void migrate(Notification.Builder notificationBuilder, File newLocation) throws IOException { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + return; + } + File oldLocation = new File(Environment.getExternalStorageDirectory(), "Minetest"); if (!oldLocation.isDirectory()) return; |