aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-10-18 11:32:27 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-10-18 13:06:54 +0200
commitc0bab02592b4799f35cb9b1c3f9c571b4fdb9899 (patch)
treea374ba1d83775b96056967cae0f19314443aa3b3
parentVersion bump (diff)
downloadwireguard-android-c0bab02592b4799f35cb9b1c3f9c571b4fdb9899.tar.xz
wireguard-android-c0bab02592b4799f35cb9b1c3f9c571b4fdb9899.zip
Suppress depreciation warnings
We know what we're doing here, and it's not nice.
-rw-r--r--app/src/main/java/com/wireguard/android/util/DownloadsFileSaver.java2
-rw-r--r--app/src/main/java/com/wireguard/android/widget/SlashDrawable.java1
2 files changed, 3 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/util/DownloadsFileSaver.java b/app/src/main/java/com/wireguard/android/util/DownloadsFileSaver.java
index efe09f3..7db46fa 100644
--- a/app/src/main/java/com/wireguard/android/util/DownloadsFileSaver.java
+++ b/app/src/main/java/com/wireguard/android/util/DownloadsFileSaver.java
@@ -62,6 +62,7 @@ public class DownloadsFileSaver {
final OutputStream contentStream = contentResolver.openOutputStream(contentUri);
if (contentStream == null)
throw new IOException(context.getString(R.string.create_downloads_file_error));
+ @SuppressWarnings("deprecation")
Cursor cursor = contentResolver.query(contentUri, new String[]{MediaColumns.DATA}, null, null, null);
String path = null;
if (cursor != null) {
@@ -86,6 +87,7 @@ public class DownloadsFileSaver {
}
return new DownloadsFile(context, contentStream, path, contentUri);
} else {
+ @SuppressWarnings("deprecation")
final File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
final File file = new File(path, name);
if (!path.isDirectory() && !path.mkdirs())
diff --git a/app/src/main/java/com/wireguard/android/widget/SlashDrawable.java b/app/src/main/java/com/wireguard/android/widget/SlashDrawable.java
index 61ce136..9fddbe6 100644
--- a/app/src/main/java/com/wireguard/android/widget/SlashDrawable.java
+++ b/app/src/main/java/com/wireguard/android/widget/SlashDrawable.java
@@ -124,6 +124,7 @@ public class SlashDrawable extends Drawable {
return mDrawable.getIntrinsicWidth();
}
+ @SuppressWarnings("deprecation")
@Override
public int getOpacity() {
return PixelFormat.OPAQUE;