From f1b541a1ebb2b931aff2ff0c211f86f84ae80538 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 24 Mar 2020 14:08:41 -0600 Subject: [PATCH] ui: squelch warnings Signed-off-by: Jason A. Donenfeld --- .../java/com/wireguard/android/fragment/TunnelListFragment.kt | 2 +- .../main/java/com/wireguard/android/widget/SlashDrawable.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt index 32bd34f6..4355d495 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt @@ -129,7 +129,7 @@ class TunnelListFragment : BaseFragment() { futureTunnels.add( Application.getTunnelManager().create( name, - Config.parse(contentResolver.openInputStream(uri)) + Config.parse(contentResolver.openInputStream(uri)!!) ).toCompletableFuture() ) } diff --git a/ui/src/main/java/com/wireguard/android/widget/SlashDrawable.kt b/ui/src/main/java/com/wireguard/android/widget/SlashDrawable.kt index a93e35f5..50741264 100644 --- a/ui/src/main/java/com/wireguard/android/widget/SlashDrawable.kt +++ b/ui/src/main/java/com/wireguard/android/widget/SlashDrawable.kt @@ -59,7 +59,9 @@ class SlashDrawable(private val mDrawable: Drawable) : Drawable() { mPath.addRoundRect(mSlashRect, 1f * width, 1f * height, Path.Direction.CW) m.setRotate(mRotation + DEFAULT_ROTATION, width / 2f, height / 2f) mPath.transform(m) - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) canvas.clipPath(mPath, Region.Op.DIFFERENCE) else canvas.clipOutPath(mPath) + @Suppress("DEPRECATION") + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) + canvas.clipPath(mPath, Region.Op.DIFFERENCE) else canvas.clipOutPath(mPath) mDrawable.draw(canvas) canvas.restore() }