QuickTileService: fix bug the wrong way

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-07-28 17:55:24 +02:00
parent 9f861096ac
commit 6ceeac93bf

View File

@ -14,6 +14,7 @@ import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.drawable.Icon; import android.graphics.drawable.Icon;
import android.os.Build; import android.os.Build;
import android.os.IBinder;
import android.service.quicksettings.Tile; import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService; import android.service.quicksettings.TileService;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
@ -44,6 +45,19 @@ public class QuickTileService extends TileService {
@Nullable private Icon iconOn; @Nullable private Icon iconOn;
@Nullable private Icon iconOff; @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") @SuppressWarnings("deprecation")
@Override @Override
public void onCreate() { public void onCreate() {