diff options
author | 2024-07-02 12:54:17 +0000 | |
---|---|---|
committer | 2024-07-02 12:59:21 +0000 | |
commit | 44366c4a24388d554e6002ea390be1dd53bd47ee (patch) | |
tree | 13baed1926fcbb7dac97621960e8c63487d9847f | |
parent | 2e891dd21584144df0343a230f0339b32fb8ad8e (diff) |
Add KeyGlyphMap providers from AOSP
Test: None
Bug: 345440920
Flag: com.android.hardware.input.keyboard_glyph_map
Change-Id: I98250c2863a8c5d4b9278b84dd104e02e04f67b3
5 files changed, 116 insertions, 0 deletions
diff --git a/packages/InputDevices/AndroidManifest.xml b/packages/InputDevices/AndroidManifest.xml index da8c0d3a4f2e..01b0bc7b3052 100644 --- a/packages/InputDevices/AndroidManifest.xml +++ b/packages/InputDevices/AndroidManifest.xml @@ -19,5 +19,23 @@ <meta-data android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS" android:resource="@xml/keyboard_layouts" /> </receiver> + + <receiver android:name=".KeyGlyphMapProvider" + android:exported="true"> + <intent-filter> + <action android:name="android.hardware.input.action.QUERY_KEYBOARD_GLYPH_MAPS" /> + </intent-filter> + <meta-data android:name="android.hardware.input.metadata.KEYBOARD_GLYPH_MAPS" + android:resource="@xml/keyboard_glyph_maps" /> + </receiver> + + <receiver android:name=".OverlayKeyGlyphMapProvider" + android:exported="true"> + <intent-filter> + <action android:name="android.hardware.input.action.QUERY_KEYBOARD_GLYPH_MAPS" /> + </intent-filter> + <meta-data android:name="android.hardware.input.metadata.KEYBOARD_GLYPH_MAPS" + android:resource="@xml/keyboard_glyph_maps_overlay" /> + </receiver> </application> </manifest> diff --git a/packages/InputDevices/res/xml/keyboard_glyph_maps.xml b/packages/InputDevices/res/xml/keyboard_glyph_maps.xml new file mode 100644 index 000000000000..b7a6f3fbf7eb --- /dev/null +++ b/packages/InputDevices/res/xml/keyboard_glyph_maps.xml @@ -0,0 +1,22 @@ +<?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. + --> +<keyboard-glyph-maps xmlns:android="http://schemas.android.com/apk/res/android"> +<!-- <key-glyph-map--> +<!-- android:glyphMap="@xml/xyz_glyph_map"--> +<!-- android:vendorId="0x1234"--> +<!-- android:productId="0x3456" />--> +</keyboard-glyph-maps>
\ No newline at end of file diff --git a/packages/InputDevices/res/xml/keyboard_glyph_maps_overlay.xml b/packages/InputDevices/res/xml/keyboard_glyph_maps_overlay.xml new file mode 100644 index 000000000000..7c036ebde09d --- /dev/null +++ b/packages/InputDevices/res/xml/keyboard_glyph_maps_overlay.xml @@ -0,0 +1,20 @@ +<?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. + --> +<keyboard-glyph-maps xmlns:android="http://schemas.android.com/apk/res/android"> +<!-- NOTE: This is reserved for glyph maps to be provided using RRO. For providing glyph maps in + AOSP use key_glyph_maps.xml instead --> +</keyboard-glyph-maps>
\ No newline at end of file diff --git a/packages/InputDevices/src/com/android/inputdevices/KeyGlyphMapProvider.java b/packages/InputDevices/src/com/android/inputdevices/KeyGlyphMapProvider.java new file mode 100644 index 000000000000..6b508dd90a40 --- /dev/null +++ b/packages/InputDevices/src/com/android/inputdevices/KeyGlyphMapProvider.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package com.android.inputdevices; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class KeyGlyphMapProvider extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + // Nothing to do at this time. + } +} diff --git a/packages/InputDevices/src/com/android/inputdevices/OverlayKeyGlyphMapProvider.java b/packages/InputDevices/src/com/android/inputdevices/OverlayKeyGlyphMapProvider.java new file mode 100644 index 000000000000..13b5b422c7ce --- /dev/null +++ b/packages/InputDevices/src/com/android/inputdevices/OverlayKeyGlyphMapProvider.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package com.android.inputdevices; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class OverlayKeyGlyphMapProvider extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + // Nothing to do at this time. + } +} |