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

Commit b679e3ee authored by Taran Singh's avatar Taran Singh Committed by Android (Google) Code Review
Browse files

Merge "Make scribe setting default_on and secure" into udc-dev

parents 04c7e4a5 fbc8c2fb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2616,7 +2616,6 @@ package android.provider {
    field @Deprecated public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
    field public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
    field public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
    field public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
    field public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats";
    field public static final String USER_PREFERRED_REFRESH_RATE = "user_preferred_refresh_rate";
    field public static final String USER_PREFERRED_RESOLUTION_HEIGHT = "user_preferred_resolution_height";
@@ -2648,6 +2647,8 @@ package android.provider {
    field public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = "show_first_crash_dialog_dev_option";
    field public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
    field public static final String STYLUS_BUTTONS_ENABLED = "stylus_buttons_enabled";
    field public static final int STYLUS_HANDWRITING_DEFAULT_VALUE = 1; // 0x1
    field public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
    field @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
    field public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
  }
+22 −11
Original line number Diff line number Diff line
@@ -7112,6 +7112,28 @@ public final class Settings {
        public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
                "input_method_selector_visibility";
        /**
         * Toggle for enabling stylus handwriting. When enabled, current Input method receives
         * stylus {@link MotionEvent}s if an {@link Editor} is focused.
         *
         * @see #STYLUS_HANDWRITING_DEFAULT_VALUE
         * @hide
         */
        @TestApi
        @Readable
        @SuppressLint("NoSettingsProvider")
        public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
        /**
         * Default value for {@link #STYLUS_HANDWRITING_ENABLED}.
         *
         * @hide
         */
        @TestApi
        @Readable
        @SuppressLint("NoSettingsProvider")
        public static final int STYLUS_HANDWRITING_DEFAULT_VALUE = 1;
        /**
         * The currently selected voice interaction service flattened ComponentName.
         * @hide
@@ -16481,17 +16503,6 @@ public final class Settings {
        @Readable
        public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
        /**
         * Toggle for enabling stylus handwriting. When enabled, current Input method receives
         * stylus {@link MotionEvent}s if an {@link Editor} is focused.
         *
         * @hide
         */
        @TestApi
        @Readable
        @SuppressLint("NoSettingsProvider")
        public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
        /**
         * Indicates whether a stylus has ever been used on the device.
         *
+4 −2
Original line number Diff line number Diff line
@@ -508,6 +508,7 @@ final class IInputMethodManagerGlobalInvoker {
    @AnyThread
    static void prepareStylusHandwritingDelegation(
            @NonNull IInputMethodClient client,
            @UserIdInt int userId,
            @NonNull String delegatePackageName,
            @NonNull String delegatorPackageName) {
        final IInputMethodManager service = getService();
@@ -516,7 +517,7 @@ final class IInputMethodManagerGlobalInvoker {
        }
        try {
            service.prepareStylusHandwritingDelegation(
                    client, delegatePackageName, delegatorPackageName);
                    client, userId, delegatePackageName, delegatorPackageName);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -525,6 +526,7 @@ final class IInputMethodManagerGlobalInvoker {
    @AnyThread
    static boolean acceptStylusHandwritingDelegation(
            @NonNull IInputMethodClient client,
            @UserIdInt int userId,
            @NonNull String delegatePackageName,
            @NonNull String delegatorPackageName) {
        final IInputMethodManager service = getService();
@@ -533,7 +535,7 @@ final class IInputMethodManagerGlobalInvoker {
        }
        try {
            return service.acceptStylusHandwritingDelegation(
                    client, delegatePackageName, delegatorPackageName);
                    client, userId, delegatePackageName, delegatorPackageName);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+4 −23
Original line number Diff line number Diff line
@@ -1553,9 +1553,7 @@ public final class InputMethodManager {
        if (fallbackContext == null) {
            return false;
        }
        if (!isStylusHandwritingEnabled(fallbackContext)) {
            return false;
        }

        return IInputMethodManagerGlobalInvoker.isStylusHandwritingAvailableAsUser(userId);
    }

@@ -2244,11 +2242,6 @@ public final class InputMethodManager {
        }

        boolean useDelegation = !TextUtils.isEmpty(delegatorPackageName);
        if (!isStylusHandwritingEnabled(view.getContext())) {
            Log.w(TAG, "Stylus handwriting pref is disabled. "
                    + "Ignoring calls to start stylus handwriting.");
            return false;
        }

        checkFocus();
        synchronized (mH) {
@@ -2264,7 +2257,8 @@ public final class InputMethodManager {
            }
            if (useDelegation) {
                return IInputMethodManagerGlobalInvoker.acceptStylusHandwritingDelegation(
                        mClient, view.getContext().getOpPackageName(), delegatorPackageName);
                        mClient, UserHandle.myUserId(), view.getContext().getOpPackageName(),
                        delegatorPackageName);
            } else {
                IInputMethodManagerGlobalInvoker.startStylusHandwriting(mClient);
            }
@@ -2272,15 +2266,6 @@ public final class InputMethodManager {
        }
    }

    private boolean isStylusHandwritingEnabled(@NonNull Context context) {
        if (Settings.Global.getInt(context.getContentResolver(),
                Settings.Global.STYLUS_HANDWRITING_ENABLED, 0) == 0) {
            Log.d(TAG, "Stylus handwriting pref is disabled.");
            return false;
        }
        return true;
    }

    /**
     * Prepares delegation of starting stylus handwriting session to a different editor in same
     * or different window than the view on which initial handwriting stroke was detected.
@@ -2344,13 +2329,9 @@ public final class InputMethodManager {
            fallbackImm.prepareStylusHandwritingDelegation(delegatorView, delegatePackageName);
        }

        if (!isStylusHandwritingEnabled(delegatorView.getContext())) {
            Log.w(TAG, "Stylus handwriting pref is disabled. "
                    + "Ignoring prepareStylusHandwritingDelegation().");
            return;
        }
        IInputMethodManagerGlobalInvoker.prepareStylusHandwritingDelegation(
                mClient,
                UserHandle.myUserId(),
                delegatePackageName,
                delegatorView.getContext().getOpPackageName());
    }
+2 −1
Original line number Diff line number Diff line
@@ -150,12 +150,13 @@ interface IInputMethodManager {

    /** Prepares delegation of starting stylus handwriting session to a different editor **/
    void prepareStylusHandwritingDelegation(in IInputMethodClient client,
                in int userId,
                in String delegatePackageName,
                in String delegatorPackageName);

    /** Accepts and starts a stylus handwriting session for the delegate view **/
    boolean acceptStylusHandwritingDelegation(in IInputMethodClient client,
                in String delegatePackageName, in String delegatorPackageName);
                in int userId, in String delegatePackageName, in String delegatorPackageName);

    /** Returns {@code true} if currently selected IME supports Stylus handwriting. */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = "
Loading