Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f9cc565 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Allow to preload home if it was died on top while locked

RWC#attachApplication no longer starts sleeping non-occluded
activities, because there is no explicit request.
E.g. while device is locked, the process of top activity is
died. And then a service started in the same process.

Now the behavior is consistent that only explicit activity request
can make the activity start rather than from random component. So
the specified case should handle by itself. Such as preloading home,
which should check whether the activity has attached to the process.

Bug: 335396307
Test: Turn off screen. Kill home process.
      Home activity should be restarted.
Change-Id: I83388a8cb2b7dd64748502b9576811d3cd18986a
parent b3942280
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -112,11 +112,11 @@ class RecentsAnimation implements RecentsAnimationCallbacks, OnRootTaskOrderChan
                mTargetActivityType);
        ActivityRecord targetActivity = getTargetActivity(targetRootTask);
        if (targetActivity != null) {
            if (targetActivity.attachedToProcess()) {
                if (targetActivity.isVisibleRequested() || targetActivity.isTopRunningActivity()) {
                    // The activity is ready.
                    return;
                }
            if (targetActivity.attachedToProcess()) {
                if (targetActivity.app.getCurrentProcState() >= PROCESS_STATE_CACHED_ACTIVITY) {
                    Slog.v(TAG, "Skip preload recents for cached proc " + targetActivity.app);
                    // The process may be frozen that cannot receive binder call.