1/*
2 * Copyright 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package com.android.internal.os;
20
21option java_outer_classname = "KeyboardConfiguredProto";
22
23/**
24 * RepeatedKeyboardLayout proto from input_extension_atoms.proto,
25 * duplicated here so that it's accessible in the build.
26 * Must be kept in sync with the version in input_extension_atoms.proto.
27 */
28
29// Message containing the repeated field for KeyboardLayoutConfig
30message RepeatedKeyboardLayoutConfig {
31  repeated KeyboardLayoutConfig keyboard_layout_config = 1;
32}
33
34// Keyboard layout configured when the device is connected
35// used in KeyboardConfigured atom
36message KeyboardLayoutConfig {
37  // Keyboard configuration details
38  // Layout type mappings found at:
39  // frameworks/base/core/res/res/values/attrs.xml
40  optional int32 keyboard_layout_type = 1;
41  // PK language language tag (e.g. en-US, ru-Cyrl, etc). This will follow
42  // BCP-47 language tag standards.
43  optional string keyboard_language_tag = 2;
44  // Selected keyboard layout name (e.g. English(US), English(Dvorak), etc.)
45  optional string keyboard_layout_name = 3;
46  // Criteria for layout selection (such as user, device, virtual keyboard based)
47  // IntDef annotation at:
48  // services/core/java/com/android/server/input/KeyboardMetricsCollector.java
49  optional int32 layout_selection_criteria = 4;
50  // Keyboard layout type provided by IME
51  optional int32 ime_layout_type = 5;
52  // Language tag provided by IME (e.g. en-US, ru-Cyrl etc.)
53  optional string ime_language_tag = 6;
54}
55