Send notification when reusing a stack as a task.
We used to always create a task even though we knew there was only one task ever created under a stack. Thus the onTaskCreated() notification is always sent with correct component name. However after we merged stack & task in some cases, stack can be reused as a task and listeners (e.g. SysUI) lost a useful notification as when stack is created componentName is still null. Therefore send out the notification when reuse is decided. Listeners can determine if it's a root task or leaf task from the nullness of component name. Bug: 150252489 Test: Smoke tests & TH. Change-Id: I0896307fd6bbfa53d95843043235e506e1a97a43
This commit is contained in:
@@ -129,11 +129,11 @@ import android.util.DisplayMetrics;
|
||||
import android.util.Slog;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
import android.view.DisplayInfo;
|
||||
import android.window.ITaskOrganizer;
|
||||
import android.view.RemoteAnimationAdapter;
|
||||
import android.view.RemoteAnimationTarget;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceControl;
|
||||
import android.window.ITaskOrganizer;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.app.IVoiceInteractor;
|
||||
@@ -594,6 +594,14 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
voiceInteractor = _voiceInteractor;
|
||||
setIntent(activity, intent, info);
|
||||
setMinDimensions(info);
|
||||
// Before we began to reuse a root task (old ActivityStack) as the leaf task, we used to
|
||||
// create a leaf task in this case. Therefore now we won't send out the task created
|
||||
// notification when we decide to reuse it here, so we send out the notification below.
|
||||
// The reason why the created notification sent out when root task is created doesn't work
|
||||
// is that realActivity isn't set until setIntent() method above is called for the first
|
||||
// time. Eventually this notification will be removed when we can populate those information
|
||||
// when root task is created.
|
||||
mAtmService.getTaskChangeNotificationController().notifyTaskCreated(mTaskId, realActivity);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user