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

Commit 0f550188 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Only increase pending relaunch count if schedule is success" into main

parents 1f4fcc07 23b9f387
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -2059,12 +2059,6 @@
      "group": "WM_DEBUG_WINDOW_TRANSITIONS_MIN",
      "group": "WM_DEBUG_WINDOW_TRANSITIONS_MIN",
      "at": "com\/android\/server\/wm\/TransitionController.java"
      "at": "com\/android\/server\/wm\/TransitionController.java"
    },
    },
    "-262984451": {
      "message": "Relaunch failed %s",
      "level": "INFO",
      "group": "WM_DEBUG_STATES",
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
    },
    "-251259736": {
    "-251259736": {
      "message": "No longer freezing: %s",
      "message": "No longer freezing: %s",
      "level": "VERBOSE",
      "level": "VERBOSE",
+2 −2
Original line number Original line Diff line number Diff line
@@ -9901,7 +9901,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            ProtoLog.i(WM_DEBUG_STATES, "Moving to %s Relaunching %s callers=%s" ,
            ProtoLog.i(WM_DEBUG_STATES, "Moving to %s Relaunching %s callers=%s" ,
                    (andResume ? "RESUMED" : "PAUSED"), this, Debug.getCallers(6));
                    (andResume ? "RESUMED" : "PAUSED"), this, Debug.getCallers(6));
            forceNewConfig = false;
            forceNewConfig = false;
            startRelaunching();
            final ClientTransactionItem callbackItem = ActivityRelaunchItem.obtain(token,
            final ClientTransactionItem callbackItem = ActivityRelaunchItem.obtain(token,
                    pendingResults, pendingNewIntents, configChangeFlags,
                    pendingResults, pendingNewIntents, configChangeFlags,
                    new MergedConfiguration(getProcessGlobalConfiguration(),
                    new MergedConfiguration(getProcessGlobalConfiguration(),
@@ -9918,11 +9917,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            transaction.addCallback(callbackItem);
            transaction.addCallback(callbackItem);
            transaction.setLifecycleStateRequest(lifecycleItem);
            transaction.setLifecycleStateRequest(lifecycleItem);
            mAtmService.getLifecycleManager().scheduleTransaction(transaction);
            mAtmService.getLifecycleManager().scheduleTransaction(transaction);
            startRelaunching();
            // Note: don't need to call pauseIfSleepingLocked() here, because the caller will only
            // Note: don't need to call pauseIfSleepingLocked() here, because the caller will only
            // request resume if this activity is currently resumed, which implies we aren't
            // request resume if this activity is currently resumed, which implies we aren't
            // sleeping.
            // sleeping.
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            ProtoLog.i(WM_DEBUG_STATES, "Relaunch failed %s", e);
            Slog.w(TAG, "Failed to relaunch " + this + ": " + e);
        }
        }


        if (andResume) {
        if (andResume) {
+6 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.server.wm;
package com.android.server.wm;


import static android.app.ActivityManager.PROCESS_STATE_CACHED_ACTIVITY;
import static android.app.ActivityManager.START_TASK_TO_FRONT;
import static android.app.ActivityManager.START_TASK_TO_FRONT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
@@ -117,6 +118,11 @@ class RecentsAnimation implements RecentsAnimationCallbacks, OnRootTaskOrderChan
                return;
                return;
            }
            }
            if (targetActivity.attachedToProcess()) {
            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.
                    return;
                }
                // The activity may be relaunched if it cannot handle the current configuration
                // The activity may be relaunched if it cannot handle the current configuration
                // changes. The activity will be paused state if it is relaunched, otherwise it
                // changes. The activity will be paused state if it is relaunched, otherwise it
                // keeps the original stopped state.
                // keeps the original stopped state.
+4 −2
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.server.wm;
package com.android.server.wm;


import static android.app.ActivityManager.PROCESS_STATE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
@@ -148,8 +149,9 @@ public class RecentsAnimationTest extends WindowTestsBase {
                anyInt() /* startFlags */, any() /* profilerInfo */);
                anyInt() /* startFlags */, any() /* profilerInfo */);


        // Assume its process is alive because the caller should be the recents service.
        // Assume its process is alive because the caller should be the recents service.
        mSystemServicesTestRule.addProcess(aInfo.packageName, aInfo.processName, 12345 /* pid */,
        final WindowProcessController proc = mSystemServicesTestRule.addProcess(aInfo.packageName,
                aInfo.applicationInfo.uid);
                aInfo.processName, 12345 /* pid */, aInfo.applicationInfo.uid);
        proc.setCurrentProcState(PROCESS_STATE_HOME);


        Intent recentsIntent = new Intent().setComponent(mRecentsComponent);
        Intent recentsIntent = new Intent().setComponent(mRecentsComponent);
        // Null animation indicates to preload.
        // Null animation indicates to preload.