| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 private volatile Engine engine = null; | 32 private volatile Engine engine = null; |
| 33 private volatile boolean isInitialized = false; | 33 private volatile boolean isInitialized = false; |
| 34 private Throwable failureCause = null; | 34 private Throwable failureCause = null; |
| 35 private static final LinkedBlockingQueue<EngineCreatedCallbackWrapper> ON_CREA TED_CALLBACKS = | 35 private static final LinkedBlockingQueue<EngineCreatedCallbackWrapper> ON_CREA TED_CALLBACKS = |
| 36 new LinkedBlockingQueue<>(); | 36 new LinkedBlockingQueue<>(); |
| 37 | 37 |
| 38 @Override | 38 @Override |
| 39 public int onStartCommand(Intent intent, int flags, int startId) | 39 public int onStartCommand(Intent intent, int flags, int startId) |
| 40 { | 40 { |
| 41 return Service.START_STICKY; | 41 return Service.START_NOT_STICKY; |
|
anton
2018/02/21 08:05:35
it's not clear why it happens only on Google Pixel
jens
2018/02/21 09:25:55
START_NOT_STICK does not trigger the service again
| |
| 42 } | 42 } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * The callback gets executed on the UI thread. | 45 * The callback gets executed on the UI thread. |
| 46 * | 46 * |
| 47 * @param context | 47 * @param context |
| 48 * @param callback | 48 * @param callback |
| 49 */ | 49 */ |
| 50 public static void startService(final Context context, final OnEngineCreatedCa llback callback) | 50 public static void startService(final Context context, final OnEngineCreatedCa llback callback) |
| 51 { | 51 { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 final boolean runOnUiThread; | 180 final boolean runOnUiThread; |
| 181 | 181 |
| 182 public EngineCreatedCallbackWrapper(final OnEngineCreatedCallback callback, | 182 public EngineCreatedCallbackWrapper(final OnEngineCreatedCallback callback, |
| 183 final boolean runOnUiThread) | 183 final boolean runOnUiThread) |
| 184 { | 184 { |
| 185 this.callback = callback; | 185 this.callback = callback; |
| 186 this.runOnUiThread = runOnUiThread; | 186 this.runOnUiThread = runOnUiThread; |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 } | 189 } |
| OLD | NEW |