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

Commit 2e891dd2 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

KeyGlyphMap API implementation

DD: go/pk_glyph_map
PRD doc: go/pk_glyph_map_prd
Test: atest KeyboardGlyphManagerTests
Bug: 345440920
Flag: com.android.hardware.input.keyboard_glyph_map

Change-Id: I5aec1bf2c7369379f1a384efd7ebd5d1a25db93a
parent 5c39f007
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -158,6 +158,34 @@ public final class InputManager {
    public static final String META_DATA_KEYBOARD_LAYOUTS =
            "android.hardware.input.metadata.KEYBOARD_LAYOUTS";

    /**
     * Broadcast Action: Query available keyboard glyph maps.
     * <p>
     * The input manager service locates available keyboard glyph maps
     * by querying broadcast receivers that are registered for this action.
     * An application can offer additional keyboard glyph maps to the user
     * by declaring a suitable broadcast receiver in its manifest.
     * </p>
     *
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_QUERY_KEYBOARD_GLYPH_MAPS =
            "android.hardware.input.action.QUERY_KEYBOARD_GLYPH_MAPS";

    /**
     * Metadata Key: Keyboard glyph map metadata associated with
     * {@link #ACTION_QUERY_KEYBOARD_GLYPH_MAPS}.
     * <p>
     * Specifies the resource id of a XML resource that describes the keyboard
     * glyph maps that are provided by the application.
     * </p>
     *
     * @hide
     */
    public static final String META_DATA_KEYBOARD_GLYPH_MAPS =
            "android.hardware.input.metadata.KEYBOARD_GLYPH_MAPS";

    /**
     * Prevent touches from being consumed by apps if these touches passed through a non-trusted
     * window from a different UID and are considered unsafe.
+395 −0

File changed.

Preview size limit exceeded, changes collapsed.

+7 −2
Original line number Diff line number Diff line
@@ -312,6 +312,9 @@ public class InputManagerService extends IInputManager.Stub
    // Manages Keyboard modifier keys remapping
    private final KeyRemapper mKeyRemapper;

    // Manages Keyboard glyphs for specific keyboards
    private final KeyboardGlyphManager mKeyboardGlyphManager;

    // Manages loading PointerIcons
    private final PointerIconCache mPointerIconCache;

@@ -461,6 +464,7 @@ public class InputManagerService extends IInputManager.Stub
        mKeyboardLedController = new KeyboardLedController(mContext, injector.getLooper(),
                mNative);
        mKeyRemapper = new KeyRemapper(mContext, mNative, mDataStore, injector.getLooper());
        mKeyboardGlyphManager = new KeyboardGlyphManager(mContext, injector.getLooper());
        mPointerIconCache = new PointerIconCache(mContext, mNative);

        mUseDevInputEventForAudioJack =
@@ -577,6 +581,7 @@ public class InputManagerService extends IInputManager.Stub
        mKeyboardLedController.systemRunning();
        mKeyRemapper.systemRunning();
        mPointerIconCache.systemRunning();
        mKeyboardGlyphManager.systemRunning();
    }

    private void reloadDeviceAliases() {
@@ -1211,8 +1216,7 @@ public class InputManagerService extends IInputManager.Stub

    @Override // Binder call
    public KeyGlyphMap getKeyGlyphMap(int deviceId) {
        // TODO(b/345440920): Implementation
        return null;
        return mKeyboardGlyphManager.getKeyGlyphMap(deviceId);
    }

    public void setFocusedApplication(int displayId, InputApplicationHandle application) {
@@ -2084,6 +2088,7 @@ public class InputManagerService extends IInputManager.Stub
        mBatteryController.dump(ipw);
        mKeyboardBacklightController.dump(ipw);
        mKeyboardLedController.dump(ipw);
        mKeyboardGlyphManager.dump(ipw);
    }

    private void dumpAssociations(IndentingPrintWriter pw) {
+382 −0

File added.

Preview size limit exceeded, changes collapsed.

+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="4dp" />
    <solid android:color="#ffffffff"/>
</shape>
 No newline at end of file
Loading