Loading core/java/android/view/ViewRootImpl.java +9 −6 Original line number Diff line number Diff line Loading @@ -201,6 +201,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.MessageQueue; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; Loading Loading @@ -3015,7 +3016,7 @@ public final class ViewRootImpl implements ViewParent, void scheduleTraversals() { if (!mTraversalScheduled) { mTraversalScheduled = true; mTraversalBarrier = mHandler.getLooper().getQueue().postSyncBarrier(); mTraversalBarrier = mQueue.postSyncBarrier(); mChoreographer.postCallback( Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null); notifyRendererOfFramePending(); Loading @@ -3026,7 +3027,7 @@ public final class ViewRootImpl implements ViewParent, void unscheduleTraversals() { if (mTraversalScheduled) { mTraversalScheduled = false; mHandler.getLooper().getQueue().removeSyncBarrier(mTraversalBarrier); mQueue.removeSyncBarrier(mTraversalBarrier); mChoreographer.removeCallbacks( Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null); } Loading @@ -3035,7 +3036,7 @@ public final class ViewRootImpl implements ViewParent, void doTraversal() { if (mTraversalScheduled) { mTraversalScheduled = false; mHandler.getLooper().getQueue().removeSyncBarrier(mTraversalBarrier); mQueue.removeSyncBarrier(mTraversalBarrier); performTraversals(); } } Loading Loading @@ -7177,6 +7178,8 @@ public final class ViewRootImpl implements ViewParent, final Executor mExecutor = (Runnable r) -> { mHandler.post(r); }; final Looper mLooper = mHandler.getLooper(); final MessageQueue mQueue = mLooper.getQueue(); /** * Something in the current window tells us we need to change the touch mode. For Loading Loading @@ -11703,7 +11706,7 @@ public final class ViewRootImpl implements ViewParent, } // If the UI thread is the same as the current thread that is dispatching // WindowStateResizeItem, then it can run directly. if (isFromResizeItem && viewAncestor.mHandler.getLooper() if (isFromResizeItem && viewAncestor.mLooper == ActivityThread.currentActivityThread().getLooper()) { viewAncestor.handleResized(layout.frames, reportDraw, layout.mergedConfiguration, layout.insetsState, forceLayout, displayId, layout.syncSeqId, Loading Loading @@ -11741,7 +11744,7 @@ public final class ViewRootImpl implements ViewParent, } // If the UI thread is the same as the current thread that is dispatching // WindowStateInsetsControlChangeItem, then it can run directly. if (isFromInsetsControlChangeItem && viewAncestor.mHandler.getLooper() if (isFromInsetsControlChangeItem && viewAncestor.mLooper == ActivityThread.currentActivityThread().getLooper()) { viewAncestor.handleInsetsControlChanged(insetsState, activeControls); return; Loading Loading @@ -12408,7 +12411,7 @@ public final class ViewRootImpl implements ViewParent, } public void runOrPost(View source, int changeType) { if (mHandler.getLooper() != Looper.myLooper()) { if (mLooper != Looper.myLooper()) { CalledFromWrongThreadException e = new CalledFromWrongThreadException("Only the " + "original thread that created a view hierarchy can touch its views."); // TODO: Throw the exception Loading
core/java/android/view/ViewRootImpl.java +9 −6 Original line number Diff line number Diff line Loading @@ -201,6 +201,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.MessageQueue; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; Loading Loading @@ -3015,7 +3016,7 @@ public final class ViewRootImpl implements ViewParent, void scheduleTraversals() { if (!mTraversalScheduled) { mTraversalScheduled = true; mTraversalBarrier = mHandler.getLooper().getQueue().postSyncBarrier(); mTraversalBarrier = mQueue.postSyncBarrier(); mChoreographer.postCallback( Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null); notifyRendererOfFramePending(); Loading @@ -3026,7 +3027,7 @@ public final class ViewRootImpl implements ViewParent, void unscheduleTraversals() { if (mTraversalScheduled) { mTraversalScheduled = false; mHandler.getLooper().getQueue().removeSyncBarrier(mTraversalBarrier); mQueue.removeSyncBarrier(mTraversalBarrier); mChoreographer.removeCallbacks( Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null); } Loading @@ -3035,7 +3036,7 @@ public final class ViewRootImpl implements ViewParent, void doTraversal() { if (mTraversalScheduled) { mTraversalScheduled = false; mHandler.getLooper().getQueue().removeSyncBarrier(mTraversalBarrier); mQueue.removeSyncBarrier(mTraversalBarrier); performTraversals(); } } Loading Loading @@ -7177,6 +7178,8 @@ public final class ViewRootImpl implements ViewParent, final Executor mExecutor = (Runnable r) -> { mHandler.post(r); }; final Looper mLooper = mHandler.getLooper(); final MessageQueue mQueue = mLooper.getQueue(); /** * Something in the current window tells us we need to change the touch mode. For Loading Loading @@ -11703,7 +11706,7 @@ public final class ViewRootImpl implements ViewParent, } // If the UI thread is the same as the current thread that is dispatching // WindowStateResizeItem, then it can run directly. if (isFromResizeItem && viewAncestor.mHandler.getLooper() if (isFromResizeItem && viewAncestor.mLooper == ActivityThread.currentActivityThread().getLooper()) { viewAncestor.handleResized(layout.frames, reportDraw, layout.mergedConfiguration, layout.insetsState, forceLayout, displayId, layout.syncSeqId, Loading Loading @@ -11741,7 +11744,7 @@ public final class ViewRootImpl implements ViewParent, } // If the UI thread is the same as the current thread that is dispatching // WindowStateInsetsControlChangeItem, then it can run directly. if (isFromInsetsControlChangeItem && viewAncestor.mHandler.getLooper() if (isFromInsetsControlChangeItem && viewAncestor.mLooper == ActivityThread.currentActivityThread().getLooper()) { viewAncestor.handleInsetsControlChanged(insetsState, activeControls); return; Loading Loading @@ -12408,7 +12411,7 @@ public final class ViewRootImpl implements ViewParent, } public void runOrPost(View source, int changeType) { if (mHandler.getLooper() != Looper.myLooper()) { if (mLooper != Looper.myLooper()) { CalledFromWrongThreadException e = new CalledFromWrongThreadException("Only the " + "original thread that created a view hierarchy can touch its views."); // TODO: Throw the exception