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

Commit 2b278ab3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Let work profile unlock screen force the work-profile IME" into main

parents 17b39811 6c8bed6d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -671,6 +671,13 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

java_aconfig_library {
    name: "android.view.inputmethod.flags-aconfig-java-host",
    aconfig_declarations: "android.view.inputmethod.flags-aconfig",
    host_supported: true,
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Vibrator
aconfig_declarations {
    name: "android.os.vibrator.flags-aconfig",
+2 −0
Original line number Diff line number Diff line
@@ -4271,6 +4271,7 @@ package android.view.inputmethod {
    method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public boolean isCurrentRootView(@NonNull android.view.View);
    method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public boolean isInputMethodPickerShown();
    method @NonNull @RequiresPermission(value=android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional=true) public boolean isStylusHandwritingAvailableAsUser(@NonNull android.os.UserHandle);
    method @FlaggedApi("android.view.inputmethod.enforce_device_policy_ime") @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public void setAllowedImesByPolicyForTest(@Nullable java.util.List<java.lang.String>);
    method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public void setStylusWindowIdleTimeoutForTest(long);
    method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public boolean shouldShowImeSwitcherButtonForTest();
    method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public void waitUntilNoPendingRequests(long);
@@ -4374,6 +4375,7 @@ package android.widget {

  @android.widget.RemoteViews.RemoteView public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener {
    method public void onActivityResult(int, int, @Nullable android.content.Intent);
    method @FlaggedApi("android.view.inputmethod.enforce_device_policy_ime") @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public final void setEnforceImePolicyUser(@Nullable android.os.UserHandle);
    field public static final int PROCESS_TEXT_REQUEST_CODE = 100; // 0x64
  }

+7 −0
Original line number Diff line number Diff line
@@ -294,6 +294,13 @@ public abstract class DevicePolicyManagerInternal {
     */
    public abstract void resetOp(int op, String packageName, @UserIdInt int userId);

    /**
     * Returns the input method packages permitted by Device policy, {@code null} means
     * all input methods are allowed.
     */
    @Nullable
    public abstract Set<String> getPermittedInputMethodPackages(@UserIdInt int userId);

    /**
     * Checks if the calling process has been granted permission to apply a device policy on a
     * specific user.
+18 −0
Original line number Diff line number Diff line
@@ -793,6 +793,22 @@ public class EditorInfo implements InputType, Parcelable {
    @Nullable
    public UserHandle targetInputMethodUser = null;

    /**
     * If not {@code null}, this editor requires that an IME is used that is allowed by the given
     * user's {@link android.app.admin.DevicePolicyManager#setPermittedInputMethods permitted IMEs}.
     *
     * <p>Note: This field will be silently ignored when
     * {@link com.android.server.inputmethod.InputMethodSystemProperty#MULTI_CLIENT_IME_ENABLED} is
     * {@code true}.</p>
     *
     * <p>Note also that pseudo handles such as {@link UserHandle#ALL} are not supported.</p>
     *
     * @hide
     */
    @RequiresPermission(INTERACT_ACROSS_USERS_FULL)
    @Nullable
    public UserHandle targetDevicePolicyUser = null;

    @IntDef({TrimPolicy.HEAD, TrimPolicy.TAIL})
    @Retention(RetentionPolicy.SOURCE)
    @interface TrimPolicy {
@@ -1381,6 +1397,7 @@ public class EditorInfo implements InputType, Parcelable {
        dest.writeStringArray(contentMimeTypes);
        UserHandle.writeToParcel(targetInputMethodUser, dest);
        dest.writeBoolean(mWritingToolsEnabled);
        UserHandle.writeToParcel(targetDevicePolicyUser, dest);
    }

    /**
@@ -1422,6 +1439,7 @@ public class EditorInfo implements InputType, Parcelable {
                    res.contentMimeTypes = source.readStringArray();
                    res.targetInputMethodUser = UserHandle.readFromParcel(source);
                    res.mWritingToolsEnabled = source.readBoolean();
                    res.targetDevicePolicyUser = UserHandle.readFromParcel(source);
                    return res;
                }

+15 −0
Original line number Diff line number Diff line
@@ -618,6 +618,21 @@ final class IInputMethodManagerGlobalInvoker {
        }
    }

    @AnyThread
    @RequiresPermission(Manifest.permission.TEST_INPUT_METHOD)
    static void setAllowedImesByPolicyForTest(
            IInputMethodClient client, @Nullable List<String> allowedPackages) {
        final IInputMethodManager service = getService();
        if (service == null) {
            return;
        }
        try {
            service.setAllowedImesByPolicyForTest(client, allowedPackages);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /** @see com.android.server.inputmethod.ImeTrackerService#onStart */
    @AnyThread
    static void onStart(@NonNull ImeTracker.Token statsToken, int uid, @ImeTracker.Type int type,
Loading