summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-29 15:46:01 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-29 15:46:01 +0200
commitbce5d852e12a0f22c4746cb64dd2d7237a4b7c01 (patch)
treec59c858faf4000b6f3415005d320f2ed39535867
parentb960b4a6cd1e95b52c306362990b296809e2ff02 (diff)
Target API 28
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/java/com/wireguard/android/Application.java1
-rw-r--r--app/src/main/java/com/wireguard/android/QuickTileService.java21
3 files changed, 13 insertions, 13 deletions
diff --git a/app/build.gradle b/app/build.gradle
index da77da48..0e1cdd07 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,12 +11,12 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
- compileSdkVersion 27
+ compileSdkVersion 28
dataBinding.enabled true
defaultConfig {
applicationId 'com.wireguard.android'
minSdkVersion 21
- targetSdkVersion 27
+ targetSdkVersion 28
versionCode 437
versionName '0.0.20180725'
buildConfigField 'int', 'MIN_SDK_VERSION', "$minSdkVersion.apiLevel"
diff --git a/app/src/main/java/com/wireguard/android/Application.java b/app/src/main/java/com/wireguard/android/Application.java
index efca15dd..72545eb4 100644
--- a/app/src/main/java/com/wireguard/android/Application.java
+++ b/app/src/main/java/com/wireguard/android/Application.java
@@ -71,6 +71,7 @@ public class Application extends android.app.Application {
* check the DN of the certs that signed the apk, without even bothering to try
* validating that they're authentic. It's a good enough heuristic.
*/
+ @SuppressWarnings("deprecation")
@Nullable
private static String getInstallSource(final Context context) {
if (BuildConfig.DEBUG)
diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java
index 20464e14..15b06670 100644
--- a/app/src/main/java/com/wireguard/android/QuickTileService.java
+++ b/app/src/main/java/com/wireguard/android/QuickTileService.java
@@ -61,6 +61,10 @@ public class QuickTileService extends TileService {
@SuppressWarnings("deprecation")
@Override
public void onCreate() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ iconOff = iconOn = Icon.createWithResource(this, R.drawable.ic_tile);
+ return;
+ }
final SlashDrawable icon = new SlashDrawable(getResources().getDrawable(R.drawable.ic_tile));
icon.setAnimationEnabled(false); /* Unfortunately we can't have animations, since Icons are marshaled. */
icon.setSlashed(false);
@@ -69,17 +73,12 @@ public class QuickTileService extends TileService {
icon.setBounds(0, 0, c.getWidth(), c.getHeight());
icon.draw(c);
iconOn = Icon.createWithBitmap(b);
- /* TODO(msf): Change this to an explicit test for P when we start targetting SDK 28 */
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O_MR1) {
- iconOff = iconOn;
- } else {
- icon.setSlashed(true);
- b = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
- c = new Canvas(b);
- icon.setBounds(0, 0, c.getWidth(), c.getHeight());
- icon.draw(c);
- iconOff = Icon.createWithBitmap(b);
- }
+ icon.setSlashed(true);
+ b = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
+ c = new Canvas(b);
+ icon.setBounds(0, 0, c.getWidth(), c.getHeight());
+ icon.draw(c);
+ iconOff = Icon.createWithBitmap(b);
}
@Override