Loading core/java/android/app/ActivityThread.java +15 −26 Original line number Diff line number Diff line Loading @@ -360,9 +360,8 @@ public final class ActivityThread extends ClientTransactionHandler /** The activities to be truly destroyed (not include relaunch). */ final Map<IBinder, ClientTransactionItem> mActivitiesToBeDestroyed = Collections.synchronizedMap(new ArrayMap<IBinder, ClientTransactionItem>()); // List of new activities (via ActivityRecord.nextIdle) that should // be reported when next we idle. ActivityClientRecord mNewActivities = null; // List of new activities that should be reported when next we idle. final ArrayList<ActivityClientRecord> mNewActivities = new ArrayList<>(); // Number of activities that are currently visible on-screen. @UnsupportedAppUsage int mNumVisibleActivities = 0; Loading Loading @@ -563,7 +562,6 @@ public final class ActivityThread extends ClientTransactionHandler private Configuration tmpConfig = new Configuration(); // Callback used for updating activity override config and camera compat control state. ViewRootImpl.ActivityConfigCallback activityConfigCallback; ActivityClientRecord nextIdle; // Indicates whether this activity is currently the topmost resumed one in the system. // This holds the last reported value from server. Loading Loading @@ -657,7 +655,6 @@ public final class ActivityThread extends ClientTransactionHandler paused = false; stopped = false; hideForNow = false; nextIdle = null; activityConfigCallback = new ViewRootImpl.ActivityConfigCallback() { @Override public void onConfigurationChanged(Configuration overrideConfig, Loading Loading @@ -2483,29 +2480,22 @@ public final class ActivityThread extends ClientTransactionHandler private class Idler implements MessageQueue.IdleHandler { @Override public final boolean queueIdle() { ActivityClientRecord a = mNewActivities; boolean stopProfiling = false; if (mBoundApplication != null && mProfiler.profileFd != null && mProfiler.autoStopProfiler) { stopProfiling = true; } if (a != null) { mNewActivities = null; final ActivityClient ac = ActivityClient.getInstance(); ActivityClientRecord prev; do { if (localLOGV) Slog.v( TAG, "Reporting idle of " + a + " finished=" + (a.activity != null && a.activity.mFinished)); while (mNewActivities.size() > 0) { final ActivityClientRecord a = mNewActivities.remove(0); if (localLOGV) { Slog.v(TAG, "Reporting idle of " + a + " finished=" + (a.activity != null && a.activity.mFinished)); } if (a.activity != null && !a.activity.mFinished) { ac.activityIdle(a.token, a.createdConfig, stopProfiling); a.createdConfig = null; } prev = a; a = a.nextIdle; prev.nextIdle = null; } while (a != null); } if (stopProfiling) { mProfiler.stopProfiling(); Loading Loading @@ -5107,8 +5097,7 @@ public final class ActivityThread extends ClientTransactionHandler } } r.nextIdle = mNewActivities; mNewActivities = r; mNewActivities.add(r); if (localLOGV) Slog.v(TAG, "Scheduling idle handler for " + r); Looper.myQueue().addIdleHandler(new Idler()); } Loading Loading @@ -5709,6 +5698,7 @@ public final class ActivityThread extends ClientTransactionHandler } if (finishing) { ActivityClient.getInstance().activityDestroyed(r.token); mNewActivities.remove(r); } mSomeActivitiesChanged = true; } Loading Loading @@ -5929,7 +5919,6 @@ public final class ActivityThread extends ClientTransactionHandler r.activity = null; r.window = null; r.hideForNow = false; r.nextIdle = null; // Merge any pending results and pending intents; don't just replace them if (pendingResults != null) { if (r.pendingResults == null) { Loading Loading
core/java/android/app/ActivityThread.java +15 −26 Original line number Diff line number Diff line Loading @@ -360,9 +360,8 @@ public final class ActivityThread extends ClientTransactionHandler /** The activities to be truly destroyed (not include relaunch). */ final Map<IBinder, ClientTransactionItem> mActivitiesToBeDestroyed = Collections.synchronizedMap(new ArrayMap<IBinder, ClientTransactionItem>()); // List of new activities (via ActivityRecord.nextIdle) that should // be reported when next we idle. ActivityClientRecord mNewActivities = null; // List of new activities that should be reported when next we idle. final ArrayList<ActivityClientRecord> mNewActivities = new ArrayList<>(); // Number of activities that are currently visible on-screen. @UnsupportedAppUsage int mNumVisibleActivities = 0; Loading Loading @@ -563,7 +562,6 @@ public final class ActivityThread extends ClientTransactionHandler private Configuration tmpConfig = new Configuration(); // Callback used for updating activity override config and camera compat control state. ViewRootImpl.ActivityConfigCallback activityConfigCallback; ActivityClientRecord nextIdle; // Indicates whether this activity is currently the topmost resumed one in the system. // This holds the last reported value from server. Loading Loading @@ -657,7 +655,6 @@ public final class ActivityThread extends ClientTransactionHandler paused = false; stopped = false; hideForNow = false; nextIdle = null; activityConfigCallback = new ViewRootImpl.ActivityConfigCallback() { @Override public void onConfigurationChanged(Configuration overrideConfig, Loading Loading @@ -2483,29 +2480,22 @@ public final class ActivityThread extends ClientTransactionHandler private class Idler implements MessageQueue.IdleHandler { @Override public final boolean queueIdle() { ActivityClientRecord a = mNewActivities; boolean stopProfiling = false; if (mBoundApplication != null && mProfiler.profileFd != null && mProfiler.autoStopProfiler) { stopProfiling = true; } if (a != null) { mNewActivities = null; final ActivityClient ac = ActivityClient.getInstance(); ActivityClientRecord prev; do { if (localLOGV) Slog.v( TAG, "Reporting idle of " + a + " finished=" + (a.activity != null && a.activity.mFinished)); while (mNewActivities.size() > 0) { final ActivityClientRecord a = mNewActivities.remove(0); if (localLOGV) { Slog.v(TAG, "Reporting idle of " + a + " finished=" + (a.activity != null && a.activity.mFinished)); } if (a.activity != null && !a.activity.mFinished) { ac.activityIdle(a.token, a.createdConfig, stopProfiling); a.createdConfig = null; } prev = a; a = a.nextIdle; prev.nextIdle = null; } while (a != null); } if (stopProfiling) { mProfiler.stopProfiling(); Loading Loading @@ -5107,8 +5097,7 @@ public final class ActivityThread extends ClientTransactionHandler } } r.nextIdle = mNewActivities; mNewActivities = r; mNewActivities.add(r); if (localLOGV) Slog.v(TAG, "Scheduling idle handler for " + r); Looper.myQueue().addIdleHandler(new Idler()); } Loading Loading @@ -5709,6 +5698,7 @@ public final class ActivityThread extends ClientTransactionHandler } if (finishing) { ActivityClient.getInstance().activityDestroyed(r.token); mNewActivities.remove(r); } mSomeActivitiesChanged = true; } Loading Loading @@ -5929,7 +5919,6 @@ public final class ActivityThread extends ClientTransactionHandler r.activity = null; r.window = null; r.hideForNow = false; r.nextIdle = null; // Merge any pending results and pending intents; don't just replace them if (pendingResults != null) { if (r.pendingResults == null) { Loading