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

Commit 906f9c62 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Moved input time out handling to ActivityTaskManagerService (14/n)

Also:
- Post handling of scheduling GC from WM to AM side.
- Removed access on package manager through mAm reference.

Bug: 80414790
Test: Existing tests pass
Change-Id: Ia76c57411fc332ea099adb6ef7975e012b4d744c
parent 5d97dd31
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -228,4 +228,7 @@ public abstract class ActivityManagerInternal {
    public abstract boolean isCurrentProfile(int userId);
    public abstract boolean hasStartedUserState(int userId);
    public abstract void finishUserSwitch(Object uss);

    /** Schedule the execution of all pending app GCs. */
    public abstract void scheduleAppGcs();
}
+0 −1
Original line number Diff line number Diff line
@@ -325,7 +325,6 @@ interface IActivityManager {
     */
    void requestWifiBugReport(in String shareTitle, in String shareDescription);

    long inputDispatchingTimedOut(int pid, boolean aboveSystem, in String reason);
    void clearPendingBackup();
    Intent getIntentForIntentSender(in IIntentSender sender);
    // This is not public because you need to be very careful in how you
+1 −1
Original line number Diff line number Diff line
@@ -3658,7 +3658,7 @@ public final class ActiveServices {
            }

            app = r.app;
            if (app != null && app.debugging) {
            if (app != null && app.isDebugging()) {
                // The app's being debugged; let it ride
                return;
            }
+94 −137

File changed.

Preview size limit exceeded, changes collapsed.

+4 −6
Original line number Diff line number Diff line
@@ -1036,7 +1036,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
                (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0, info.configChanges,
                task.voiceSession != null, mLaunchTaskBehind, isAlwaysFocusable(),
                appInfo.targetSdkVersion, mRotationAnimationHint,
                ActivityManagerService.getInputDispatchingTimeoutLocked(this) * 1000000L);
                ActivityTaskManagerService.getInputDispatchingTimeoutLocked(this) * 1000000L);

        task.addActivityToTop(this);

@@ -2134,7 +2134,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
                    mStackSupervisor.processStoppingActivitiesLocked(null /* idleActivity */,
                            false /* remove */, true /* processPausingActivities */);
                }
                service.mAm.scheduleAppGcsLocked();
                service.scheduleAppGcsLocked();
            }
        }
    }
@@ -2159,13 +2159,11 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
                    !hasProcess() || app.getPid() == windowPid || windowPid == -1;
        }
        if (windowFromSameProcessAsActivity) {
            return service.mAm.inputDispatchingTimedOut(
                    (ProcessRecord) anrApp.mOwner, anrActivity, this, false, reason);
            return service.inputDispatchingTimedOut(anrApp, anrActivity, this, false, reason);
        } else {
            // In this case another process added windows using this activity token. So, we call the
            // generic service input dispatch timed out method so that the right process is blamed.
            return service.mAm.inputDispatchingTimedOut(
                    windowPid, false /* aboveSystem */, reason) < 0;
            return service.inputDispatchingTimedOut(windowPid, false /* aboveSystem */, reason) < 0;
        }
    }

Loading