Loading core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -1541,7 +1541,7 @@ public final class ActivityThread extends ClientTransactionHandler { public void scheduleTrimMemory(int level) { final Runnable r = PooledLambda.obtainRunnable(ActivityThread::handleTrimMemory, ActivityThread.this, level); ActivityThread.this, level).recycleOnUse(); // Schedule trimming memory after drawing the frame to minimize jank-risk. Choreographer choreographer = Choreographer.getMainThreadInstance(); if (choreographer != null) { Loading core/java/android/app/UiAutomation.java +2 −3 Original line number Diff line number Diff line Loading @@ -1197,10 +1197,9 @@ public final class UiAutomation { } if (listener != null) { // Calling out only without a lock held. mLocalCallbackHandler.post(PooledLambda.obtainRunnable( mLocalCallbackHandler.sendMessage(PooledLambda.obtainMessage( OnAccessibilityEventListener::onAccessibilityEvent, listener, AccessibilityEvent.obtain(event)) .recycleOnUse()); listener, AccessibilityEvent.obtain(event))); } } Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +2 −2 Original line number Diff line number Diff line Loading @@ -3188,10 +3188,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D // Kill the running processes. Post on handle since we don't want to hold the service lock // while calling into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( ActivityManagerInternal::killProcessesForRemovedTask, mService.mAmInternal, procsToKill); mService.mH.post(r); mService.mH.sendMessage(m); } /** Loading services/core/java/com/android/server/am/OomAdjProfiler.java +2 −2 Original line number Diff line number Diff line Loading @@ -91,9 +91,9 @@ public class OomAdjProfiler { return; } mSystemServerCpuTimeUpdateScheduled = true; BackgroundThread.getHandler().post(PooledLambda.obtainRunnable( BackgroundThread.getHandler().sendMessage(PooledLambda.obtainMessage( OomAdjProfiler::updateSystemServerCpuTime, this, mOnBattery, mScreenOff).recycleOnUse()); this, mOnBattery, mScreenOff)); } } Loading services/core/java/com/android/server/am/WindowProcessController.java +13 −10 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.app.servertransaction.ConfigurationChangeItem; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.res.Configuration; import android.os.Message; import android.os.RemoteException; import android.util.ArraySet; import android.util.Log; Loading Loading @@ -510,48 +511,50 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio void clearProfilerIfNeeded() { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. mAtm.mH.post(() -> mListener.clearProfilerIfNeeded()); mAtm.mH.sendMessage(PooledLambda.obtainMessage( WindowProcessListener::clearProfilerIfNeeded, mListener)); } void updateProcessInfo(boolean updateServiceConnectionActivities, boolean updateLru, boolean activityChange, boolean updateOomAdj) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable(WindowProcessListener::updateProcessInfo, final Message m = PooledLambda.obtainMessage(WindowProcessListener::updateProcessInfo, mListener, updateServiceConnectionActivities, updateLru, activityChange, updateOomAdj); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } void updateServiceConnectionActivities() { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. mAtm.mH.post(() -> mListener.updateServiceConnectionActivities()); mAtm.mH.sendMessage(PooledLambda.obtainMessage( WindowProcessListener::updateServiceConnectionActivities, mListener)); } void setPendingUiClean(boolean pendingUiClean) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( WindowProcessListener::setPendingUiClean, mListener, pendingUiClean); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } void setPendingUiCleanAndForceProcessStateUpTo(int newState) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( WindowProcessListener::setPendingUiCleanAndForceProcessStateUpTo, mListener, newState); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } void setRemoved(boolean removed) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( WindowProcessListener::setRemoved, mListener, removed); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } @Override Loading Loading
core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -1541,7 +1541,7 @@ public final class ActivityThread extends ClientTransactionHandler { public void scheduleTrimMemory(int level) { final Runnable r = PooledLambda.obtainRunnable(ActivityThread::handleTrimMemory, ActivityThread.this, level); ActivityThread.this, level).recycleOnUse(); // Schedule trimming memory after drawing the frame to minimize jank-risk. Choreographer choreographer = Choreographer.getMainThreadInstance(); if (choreographer != null) { Loading
core/java/android/app/UiAutomation.java +2 −3 Original line number Diff line number Diff line Loading @@ -1197,10 +1197,9 @@ public final class UiAutomation { } if (listener != null) { // Calling out only without a lock held. mLocalCallbackHandler.post(PooledLambda.obtainRunnable( mLocalCallbackHandler.sendMessage(PooledLambda.obtainMessage( OnAccessibilityEventListener::onAccessibilityEvent, listener, AccessibilityEvent.obtain(event)) .recycleOnUse()); listener, AccessibilityEvent.obtain(event))); } } Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +2 −2 Original line number Diff line number Diff line Loading @@ -3188,10 +3188,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D // Kill the running processes. Post on handle since we don't want to hold the service lock // while calling into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( ActivityManagerInternal::killProcessesForRemovedTask, mService.mAmInternal, procsToKill); mService.mH.post(r); mService.mH.sendMessage(m); } /** Loading
services/core/java/com/android/server/am/OomAdjProfiler.java +2 −2 Original line number Diff line number Diff line Loading @@ -91,9 +91,9 @@ public class OomAdjProfiler { return; } mSystemServerCpuTimeUpdateScheduled = true; BackgroundThread.getHandler().post(PooledLambda.obtainRunnable( BackgroundThread.getHandler().sendMessage(PooledLambda.obtainMessage( OomAdjProfiler::updateSystemServerCpuTime, this, mOnBattery, mScreenOff).recycleOnUse()); this, mOnBattery, mScreenOff)); } } Loading
services/core/java/com/android/server/am/WindowProcessController.java +13 −10 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.app.servertransaction.ConfigurationChangeItem; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.res.Configuration; import android.os.Message; import android.os.RemoteException; import android.util.ArraySet; import android.util.Log; Loading Loading @@ -510,48 +511,50 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio void clearProfilerIfNeeded() { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. mAtm.mH.post(() -> mListener.clearProfilerIfNeeded()); mAtm.mH.sendMessage(PooledLambda.obtainMessage( WindowProcessListener::clearProfilerIfNeeded, mListener)); } void updateProcessInfo(boolean updateServiceConnectionActivities, boolean updateLru, boolean activityChange, boolean updateOomAdj) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable(WindowProcessListener::updateProcessInfo, final Message m = PooledLambda.obtainMessage(WindowProcessListener::updateProcessInfo, mListener, updateServiceConnectionActivities, updateLru, activityChange, updateOomAdj); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } void updateServiceConnectionActivities() { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. mAtm.mH.post(() -> mListener.updateServiceConnectionActivities()); mAtm.mH.sendMessage(PooledLambda.obtainMessage( WindowProcessListener::updateServiceConnectionActivities, mListener)); } void setPendingUiClean(boolean pendingUiClean) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( WindowProcessListener::setPendingUiClean, mListener, pendingUiClean); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } void setPendingUiCleanAndForceProcessStateUpTo(int newState) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( WindowProcessListener::setPendingUiCleanAndForceProcessStateUpTo, mListener, newState); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } void setRemoved(boolean removed) { if (mListener == null) return; // Posting on handler so WM lock isn't held when we call into AM. final Runnable r = PooledLambda.obtainRunnable( final Message m = PooledLambda.obtainMessage( WindowProcessListener::setRemoved, mListener, removed); mAtm.mH.post(r); mAtm.mH.sendMessage(m); } @Override Loading