From 20717ff1286e1937eda7d92308fb5671ec70083f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 18 Oct 2019 11:32:27 +0200 Subject: [PATCH] Suppress depreciation warnings We know what we're doing here, and it's not nice. Signed-off-by: Jason A. Donenfeld --- .../java/com/wireguard/android/util/DownloadsFileSaver.java | 2 ++ .../main/java/com/wireguard/android/widget/SlashDrawable.java | 1 + 2 files changed, 3 insertions(+) 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 efe09f3f..7db46fa9 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 61ce1362..9fddbe6f 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;