Loading core/java/android/app/Activity.java +1 −0 Original line number Diff line number Diff line Loading @@ -6142,6 +6142,7 @@ public class Activity extends ContextThemeWrapper * * @param action the action to run on the UI thread */ @Override public final void runOnUiThread(Runnable action) { if (Thread.currentThread() != mUiThread) { mHandler.post(action); Loading core/java/android/view/autofill/AutofillManager.java +23 −13 Original line number Diff line number Diff line Loading @@ -258,6 +258,11 @@ public final class AutofillManager { * @return The view, or {@code null} if not found */ @Nullable View findViewByAccessibilityIdTraversal(int viewId); /** * Runs the specified action on the UI thread. */ void runOnUiThread(Runnable action); } /** Loading Loading @@ -1233,6 +1238,15 @@ public final class AutofillManager { return mService != null; } private void post(Runnable runnable) { final AutofillClient client = getClientLocked(); if (client == null) { if (sVerbose) Log.v(TAG, "ignoring post() because client is null"); return; } client.runOnUiThread(runnable); } /** * View tracking information. Once all tracked views become invisible the session is finished. */ Loading Loading @@ -1516,8 +1530,7 @@ public final class AutofillManager { public void setState(boolean enabled, boolean resetSession, boolean resetClient) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.setState(enabled, resetSession, resetClient)); afm.post(() -> afm.setState(enabled, resetSession, resetClient)); } } Loading @@ -1525,8 +1538,7 @@ public final class AutofillManager { public void autofill(int sessionId, List<AutofillId> ids, List<AutofillValue> values) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.autofill(sessionId, ids, values)); afm.post(() -> afm.autofill(sessionId, ids, values)); } } Loading @@ -1535,8 +1547,7 @@ public final class AutofillManager { Intent fillInIntent) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.authenticate(sessionId, authenticationId, intent, fillInIntent)); afm.post(() -> afm.authenticate(sessionId, authenticationId, intent, fillInIntent)); } } Loading @@ -1545,8 +1556,7 @@ public final class AutofillManager { Rect anchorBounds, IAutofillWindowPresenter presenter) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.requestShowFillUi(sessionId, id, width, height, anchorBounds, afm.post(() -> afm.requestShowFillUi(sessionId, id, width, height, anchorBounds, presenter)); } } Loading @@ -1555,7 +1565,7 @@ public final class AutofillManager { public void requestHideFillUi(int sessionId, AutofillId id) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> afm.requestHideFillUi(id)); afm.post(() -> afm.requestHideFillUi(id)); } } Loading @@ -1563,7 +1573,7 @@ public final class AutofillManager { public void notifyNoFillUi(int sessionId, AutofillId id) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> afm.notifyNoFillUi(sessionId, id)); afm.post(() -> afm.notifyNoFillUi(sessionId, id)); } } Loading @@ -1571,7 +1581,7 @@ public final class AutofillManager { public void startIntentSender(IntentSender intentSender) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> { afm.post(() -> { try { afm.mContext.startIntentSender(intentSender, null, 0, 0, 0); } catch (IntentSender.SendIntentException e) { Loading @@ -1586,7 +1596,7 @@ public final class AutofillManager { boolean saveOnAllViewsInvisible, AutofillId[] fillableIds) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> afm.post(() -> afm.setTrackedViews(sessionId, ids, saveOnAllViewsInvisible, fillableIds) ); } Loading Loading
core/java/android/app/Activity.java +1 −0 Original line number Diff line number Diff line Loading @@ -6142,6 +6142,7 @@ public class Activity extends ContextThemeWrapper * * @param action the action to run on the UI thread */ @Override public final void runOnUiThread(Runnable action) { if (Thread.currentThread() != mUiThread) { mHandler.post(action); Loading
core/java/android/view/autofill/AutofillManager.java +23 −13 Original line number Diff line number Diff line Loading @@ -258,6 +258,11 @@ public final class AutofillManager { * @return The view, or {@code null} if not found */ @Nullable View findViewByAccessibilityIdTraversal(int viewId); /** * Runs the specified action on the UI thread. */ void runOnUiThread(Runnable action); } /** Loading Loading @@ -1233,6 +1238,15 @@ public final class AutofillManager { return mService != null; } private void post(Runnable runnable) { final AutofillClient client = getClientLocked(); if (client == null) { if (sVerbose) Log.v(TAG, "ignoring post() because client is null"); return; } client.runOnUiThread(runnable); } /** * View tracking information. Once all tracked views become invisible the session is finished. */ Loading Loading @@ -1516,8 +1530,7 @@ public final class AutofillManager { public void setState(boolean enabled, boolean resetSession, boolean resetClient) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.setState(enabled, resetSession, resetClient)); afm.post(() -> afm.setState(enabled, resetSession, resetClient)); } } Loading @@ -1525,8 +1538,7 @@ public final class AutofillManager { public void autofill(int sessionId, List<AutofillId> ids, List<AutofillValue> values) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.autofill(sessionId, ids, values)); afm.post(() -> afm.autofill(sessionId, ids, values)); } } Loading @@ -1535,8 +1547,7 @@ public final class AutofillManager { Intent fillInIntent) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.authenticate(sessionId, authenticationId, intent, fillInIntent)); afm.post(() -> afm.authenticate(sessionId, authenticationId, intent, fillInIntent)); } } Loading @@ -1545,8 +1556,7 @@ public final class AutofillManager { Rect anchorBounds, IAutofillWindowPresenter presenter) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( () -> afm.requestShowFillUi(sessionId, id, width, height, anchorBounds, afm.post(() -> afm.requestShowFillUi(sessionId, id, width, height, anchorBounds, presenter)); } } Loading @@ -1555,7 +1565,7 @@ public final class AutofillManager { public void requestHideFillUi(int sessionId, AutofillId id) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> afm.requestHideFillUi(id)); afm.post(() -> afm.requestHideFillUi(id)); } } Loading @@ -1563,7 +1573,7 @@ public final class AutofillManager { public void notifyNoFillUi(int sessionId, AutofillId id) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> afm.notifyNoFillUi(sessionId, id)); afm.post(() -> afm.notifyNoFillUi(sessionId, id)); } } Loading @@ -1571,7 +1581,7 @@ public final class AutofillManager { public void startIntentSender(IntentSender intentSender) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> { afm.post(() -> { try { afm.mContext.startIntentSender(intentSender, null, 0, 0, 0); } catch (IntentSender.SendIntentException e) { Loading @@ -1586,7 +1596,7 @@ public final class AutofillManager { boolean saveOnAllViewsInvisible, AutofillId[] fillableIds) { final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post(() -> afm.post(() -> afm.setTrackedViews(sessionId, ids, saveOnAllViewsInvisible, fillableIds) ); } Loading