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

Commit 659e6744 authored by Kai Li's avatar Kai Li
Browse files

Auto-focus the input box and show IME after remote fill.

Bug: 403422950
Flag: android.view.contentcapture.flags.enable_system_ui_underlay
Change-Id: Ie7f2243698294f1ab03bacbdc38f7cf677e0bd28
Test: atest FrameworksCoreTests:ActivityThreadTest
parent 664cee66
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@ import android.view.ViewRootImpl;
import android.view.ViewRootImpl.ActivityConfigCallback;
import android.view.Window;
import android.view.Window.WindowControllerCallback;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.view.accessibility.AccessibilityEvent;
@@ -10210,6 +10212,12 @@ public class Activity extends ContextThemeWrapper
                    if (view != null) {
                        // TODO: b/410146465 support virtual views
                        view.autofill(autofillValue);
                        view.requestFocus();
                        WindowInsetsController windowInsetsController =
                                view.getWindowInsetsController();
                        if (windowInsetsController != null) {
                            windowInsetsController.show(WindowInsets.Type.ime());
                        }
                    }
                });
    }
+1 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ public class ActivityThreadTest {
        InstrumentationRegistry.getInstrumentation().waitForIdleSync();

        assertEquals("test", editText.getText().toString());
        assertTrue("edit text should be focused", editText.isFocused());
    }

    @Test