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

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

Merge "Introduce Stylus handwriting developer option" into tm-dev

parents 4b6d20e5 ede3a97e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2163,6 +2163,7 @@ 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";
+13 −0
Original line number Diff line number Diff line
@@ -85,8 +85,10 @@ import android.util.ArraySet;
import android.util.Log;
import android.util.MemoryIntArray;
import android.view.Display;
import android.view.MotionEvent;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.Editor;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.Preconditions;
@@ -15517,6 +15519,17 @@ 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";
        /**
         * Exemptions to the hidden API blacklist.
         *
+8 −1
Original line number Diff line number Diff line
@@ -1919,10 +1919,17 @@ public final class InputMethodManager {
        if (fallbackImm != null) {
            fallbackImm.startStylusHandwriting(view);
        }
        Objects.requireNonNull(view);

        if (Settings.Global.getInt(view.getContext().getContentResolver(),
                Settings.Global.STYLUS_HANDWRITING_ENABLED, 0) == 0) {
            Log.d(TAG, "Ignoring startStylusHandwriting(view) as stylus handwriting is disabled");
            return;
        }

        checkFocus();
        synchronized (mH) {
            if (view == null || !hasServedByInputMethodLocked(view)) {
            if (!hasServedByInputMethodLocked(view)) {
                Log.w(TAG,
                        "Ignoring startStylusHandwriting() as view=" + view + " is not served.");
                return;
+1 −0
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ public class SettingsBackupTest {
                    Settings.Global.DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD,
                    Settings.Global.SMART_REPLIES_IN_NOTIFICATIONS_FLAGS,
                    Settings.Global.SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS,
                    Settings.Global.STYLUS_HANDWRITING_ENABLED,
                    Settings.Global.ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT,
                    Settings.Global.ENABLE_MULTI_SLOT_TIMEOUT_MILLIS,
                    Settings.Global.ENHANCED_4G_MODE_ENABLED,