summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorFabian Kozynski <kozynski@google.com>2021-01-22 15:11:27 -0500
committerFabian Kozynski <kozynski@google.com>2021-01-22 15:11:27 -0500
commit6b7e9a3058dccbac09bbbb978ad6bd8fc3475905 (patch)
tree084107381ed82568e4825ec7ab3615282647361e /core/java
parent8357d23b51f8332d02980b407349a0024eaccbd2 (diff)
Revert ag/13072747
The change in ag/13072747 could bring some unexpected behavior, as it would drop important messages (onTileAdded, onTileDestroyed). Given that there is no way to prevent messsages delivered after onDestroy without implementing some kind of callback mechanism, instead add explicit documentation about this behavior. Test: build Fixes: 172511340 Change-Id: I3fa6e41389477cbafa31809cd5041d67a76ccb91
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/service/quicksettings/TileService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/service/quicksettings/TileService.java b/core/java/android/service/quicksettings/TileService.java
index 53290e2ede5a..b507328d21a1 100644
--- a/core/java/android/service/quicksettings/TileService.java
+++ b/core/java/android/service/quicksettings/TileService.java
@@ -46,7 +46,7 @@ import com.android.internal.R;
*
* <p>The lifecycle of a TileService is different from some other services in
* that it may be unbound during parts of its lifecycle. Any of the following
- * lifecycle events can happen indepently in a separate binding/creation of the
+ * lifecycle events can happen independently in a separate binding/creation of the
* service.</p>
*
* <ul>
@@ -58,6 +58,9 @@ import com.android.internal.R;
*
* <li>When the user removes a tile from Quick Settings {@link #onTileRemoved()}
* will be called.</li>
+ *
+ * <li>{@link #onTileAdded()} and {@link #onTileRemoved()} may be called outside of the
+ * {@link #onCreate()} - {@link #onDestroy()} window</li>
* </ul>
* <p>TileService will be detected by tiles that match the {@value #ACTION_QS_TILE}
* and require the permission "android.permission.BIND_QUICK_SETTINGS_TILE".
@@ -176,9 +179,6 @@ public class TileService extends Service {
@Override
public void onDestroy() {
- // As this call will come asynchronously in the main thread, prevent calls from the binder
- // being processed after this.
- mHandler.removeCallbacksAndMessages(null);
if (mListening) {
onStopListening();
mListening = false;