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

Commit a5a81d24 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add IMMS#showInputMethodPickerFromSystem."

parents 13f94032 0b05f9e4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2281,6 +2281,15 @@ public final class ActivityThread extends ClientTransactionHandler {
        }
    }

    /**
     * Create the context instance base on system resources & display information which used for UI.
     * @param displayId The ID of the display where the UI is shown.
     * @see ContextImpl#createSystemUiContext(ContextImpl, int)
     */
    public ContextImpl createSystemUiContext(int displayId) {
        return ContextImpl.createSystemUiContext(getSystemUiContext(), displayId);
    }

    public void installSystemApplicationInfo(ApplicationInfo info, ClassLoader classLoader) {
        synchronized (this) {
            getSystemContext().installSystemApplicationInfo(info, classLoader);
+14 −2
Original line number Diff line number Diff line
@@ -2407,16 +2407,28 @@ class ContextImpl extends Context {
    /**
     * System Context to be used for UI. This Context has resources that can be themed.
     * Make sure that the created system UI context shares the same LoadedApk as the system context.
     * @param systemContext The system context which created by
     *                      {@link #createSystemContext(ActivityThread)}.
     * @param displayId The ID of the display where the UI is shown.
     */
    static ContextImpl createSystemUiContext(ContextImpl systemContext) {
    static ContextImpl createSystemUiContext(ContextImpl systemContext, int displayId) {
        final LoadedApk packageInfo = systemContext.mPackageInfo;
        ContextImpl context = new ContextImpl(null, systemContext.mMainThread, packageInfo, null,
                null, null, 0, null);
        context.setResources(createResources(null, packageInfo, null, Display.DEFAULT_DISPLAY, null,
        context.setResources(createResources(null, packageInfo, null, displayId, null,
                packageInfo.getCompatibilityInfo()));
        context.updateDisplay(displayId);
        return context;
    }

    /**
     * The overloaded method of {@link #createSystemUiContext(ContextImpl, int)}.
     * Uses {@Code Display.DEFAULT_DISPLAY} as the target display.
     */
    static ContextImpl createSystemUiContext(ContextImpl systemContext) {
        return createSystemUiContext(systemContext, Display.DEFAULT_DISPLAY);
    }

    @UnsupportedAppUsage
    static ContextImpl createAppContext(ActivityThread mainThread, LoadedApk packageInfo) {
        if (packageInfo == null) throw new IllegalArgumentException("packageInfo");
+5 −3
Original line number Diff line number Diff line
@@ -2354,17 +2354,19 @@ public final class InputMethodManager {
    }

    /**
     * Shows the input method chooser dialog.
     * Shows the input method chooser dialog from system.
     *
     * @param showAuxiliarySubtypes Set true to show auxiliary input methods.
     * @param displayId The ID of the display where the chooser dialog should be shown.
     * @hide
     */
    public void showInputMethodPicker(boolean showAuxiliarySubtypes) {
    @RequiresPermission(WRITE_SECURE_SETTINGS)
    public void showInputMethodPickerFromSystem(boolean showAuxiliarySubtypes, int displayId) {
        final int mode = showAuxiliarySubtypes
                ? SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES
                : SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES;
        try {
            mService.showInputMethodPickerFromClient(mClient, mode);
            mService.showInputMethodPickerFromSystem(mClient, mode, displayId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ interface IInputMethodManager {

    void showInputMethodPickerFromClient(in IInputMethodClient client,
            int auxiliarySubtypeMode);
    void showInputMethodPickerFromSystem(in IInputMethodClient client, int auxiliarySubtypeMode,
            int displayId);
    void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
    boolean isInputMethodPickerShownForTest();
    // TODO(Bug 114488811): this can be removed once we deprecate special null token rule.
+2 −1
Original line number Diff line number Diff line
@@ -193,7 +193,8 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
            public void onClick(View v) {
                mCallback.userActivity(); // Leave the screen on a bit longer
                // Do not show auxiliary subtypes in password lock screen.
                mImm.showInputMethodPicker(false /* showAuxiliarySubtypes */);
                mImm.showInputMethodPickerFromSystem(false /* showAuxiliarySubtypes */,
                        getContext().getDisplayId());
            }
        });

Loading