Notify task changed listeners when a pinned activity is removed
Bug: 27558494
Change-Id: I68573e5654f476e0b3027ad80d0e86496867f128
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 004be34..4eae45c 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -759,6 +759,14 @@
if (r.isPersistable()) {
mService.notifyTaskPersisterLocked(this, false);
}
+
+ if (stack != null && stack.mStackId == PINNED_STACK_ID) {
+ // We normally notify listeners of task stack changes on pause, however pinned stack
+ // activities are normally in the paused state so no notification will be sent there
+ // before the activity is removed. We send it here so instead.
+ mService.notifyTaskStackChangedLocked();
+ }
+
if (mActivities.isEmpty()) {
return !mReuseTask;
}