summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-28 17:55:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-28 17:55:24 +0200
commit6ceeac93bf2ceca557c07a81b06bff6f500a9a51 (patch)
tree727213e35bfb8ad8ef3b5b04ff0e7df1319f7fb7 /app/src/main/java
parent9f861096acea36599d0e5943d0204da5eae91807 (diff)
QuickTileService: fix bug the wrong way
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/wireguard/android/QuickTileService.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java
index 9e0790b6..20464e14 100644
--- a/app/src/main/java/com/wireguard/android/QuickTileService.java
+++ b/app/src/main/java/com/wireguard/android/QuickTileService.java
@@ -14,6 +14,7 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Icon;
import android.os.Build;
+import android.os.IBinder;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.support.annotation.Nullable;
@@ -44,6 +45,19 @@ public class QuickTileService extends TileService {
@Nullable private Icon iconOn;
@Nullable private Icon iconOff;
+ /* This works around an annoying unsolved frameworks bug some people are hitting. */
+ @Override
+ @Nullable
+ public IBinder onBind(final Intent intent) {
+ IBinder ret = null;
+ try {
+ ret = super.onBind(intent);
+ } catch (final Exception e) {
+ Log.d(TAG, "Failed to bind to TileService", e);
+ }
+ return ret;
+ }
+
@SuppressWarnings("deprecation")
@Override
public void onCreate() {