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

Commit 98b41d00 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Fix sluggish to launch an app" into ics

parents 4c348f88 d96dab72
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3004,7 +3004,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
    }
    final void logAppTooSlow(ProcessRecord app, long startTime, String msg) {
    final void logAppTooSlow(int pid, long startTime, String msg) {
        if (IS_USER_BUILD) {
            return;
        }
@@ -3037,7 +3037,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                sb.append(msg);
                FileOutputStream fos = new FileOutputStream(tracesFile);
                fos.write(sb.toString().getBytes());
                if (app == null) {
                if (pid <= 0) {
                    fos.write("\n*** No application process!".getBytes());
                }
                fos.close();
@@ -3047,9 +3047,9 @@ public final class ActivityManagerService extends ActivityManagerNative
                return;
            }
            if (app != null) {
            if (pid > 0) {
                ArrayList<Integer> firstPids = new ArrayList<Integer>();
                firstPids.add(app.pid);
                firstPids.add(pid);
                dumpStackTraces(tracesPath, firstPids, null, null);
            }
+20 −4
Original line number Diff line number Diff line
@@ -307,11 +307,18 @@ final class ActivityStack {
                    // We don't at this point know if the activity is fullscreen,
                    // so we need to be conservative and assume it isn't.
                    Slog.w(TAG, "Activity pause timeout for " + r);
                    int pid = -1;
                    long pauseTime = 0;
                    String m = null;
                    synchronized (mService) {
                        if (r.app != null) {
                            mService.logAppTooSlow(r.app, r.pauseTime,
                                    "pausing " + r);
                            pid = r.app.pid;
                        }
                        pauseTime = r.pauseTime;
                        m = "pausing " + r;
                    }
                    if (pid > 0) {
                        mService.logAppTooSlow(pid, pauseTime, m);
                    }

                    activityPaused(r != null ? r.appToken : null, true);
@@ -332,11 +339,20 @@ final class ActivityStack {
                } break;
                case LAUNCH_TICK_MSG: {
                    ActivityRecord r = (ActivityRecord)msg.obj;
                    int pid = -1;
                    long launchTickTime = 0;
                    String m = null;
                    synchronized (mService) {
                        if (r.continueLaunchTickingLocked()) {
                            mService.logAppTooSlow(r.app, r.launchTickTime,
                                    "launching " + r);
                            if (r.app != null) {
                                pid = r.app.pid;
                            }
                            launchTickTime = r.launchTickTime;
                            m = "launching " + r;
                        }
                    }
                    if (pid > 0) {
                        mService.logAppTooSlow(pid, launchTickTime, m);
                    }
                } break;
                case DESTROY_TIMEOUT_MSG: {