|
|
|
@ -49,12 +49,26 @@ public class ServiceTileSynchronize extends TileService implements SharedPrefere
|
|
|
|
|
Log.i("Update tile synchronize=" + enabled);
|
|
|
|
|
|
|
|
|
|
Tile tile = getQsTile();
|
|
|
|
|
if (tile != null) {
|
|
|
|
|
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
|
|
|
|
tile.setIcon(Icon.createWithResource(this,
|
|
|
|
|
enabled ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24));
|
|
|
|
|
tile.updateTile();
|
|
|
|
|
}
|
|
|
|
|
if (tile != null)
|
|
|
|
|
try {
|
|
|
|
|
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
|
|
|
|
tile.setIcon(Icon.createWithResource(this,
|
|
|
|
|
enabled ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24));
|
|
|
|
|
tile.updateTile();
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
/*
|
|
|
|
|
java.lang.IllegalArgumentException: Service not registered: com.android.systemui.qs.external.TileLifecycleManager@9b4b3b0
|
|
|
|
|
at android.os.Parcel.createException(Parcel.java:1954)
|
|
|
|
|
at android.os.Parcel.readException(Parcel.java:1918)
|
|
|
|
|
at android.os.Parcel.readException(Parcel.java:1868)
|
|
|
|
|
at android.service.quicksettings.IQSService$Stub$Proxy.updateQsTile(IQSService.java:219)
|
|
|
|
|
at android.service.quicksettings.Tile.updateTile(Tile.java:182)
|
|
|
|
|
at eu.faircode.email.ServiceTileSynchronize.update(SourceFile:56)
|
|
|
|
|
at eu.faircode.email.ServiceTileSynchronize.onStartListening(SourceFile:37)
|
|
|
|
|
at android.service.quicksettings.TileService$H.handleMessage(TileService.java:407)
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void onStopListening() {
|
|
|
|
|