diff options
author | Danny Lin <danny@kdrag0n.dev> | 2021-12-06 22:06:51 -0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-08-16 15:56:54 +0800 |
commit | 21ed1a30668d797da0f84c7c0f758adbaa6a38c8 (patch) | |
tree | b5197dde89a46bb0584230ea9a3a45ee9f5a5e1d | |
parent | e67365e2280648fa56824a70c0a100386b7e242d (diff) |
gs201: overlay: Enable multiple vibration strength levels
All production GS201 devices have CS40L2x haptic driver ICs that support
multiple intensities, so expose the Off/Low/Medium/High vibration
strength options like stock.
Change-Id: I72645b5bd5772e182592a630df86f9b6166b4923
-rw-r--r-- | ice_common.mk | 8 | ||||
-rw-r--r-- | overlay-ice/packages/apps/Settings/res/values/config.xml | 36 |
2 files changed, 44 insertions, 0 deletions
diff --git a/ice_common.mk b/ice_common.mk new file mode 100644 index 00000000..9b70ee4a --- /dev/null +++ b/ice_common.mk @@ -0,0 +1,8 @@ +# +# Copyright (C) 2022 Project ICE +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Overlays +DEVICE_PACKAGE_OVERLAYS += device/google/gs201/overlay-ice diff --git a/overlay-ice/packages/apps/Settings/res/values/config.xml b/overlay-ice/packages/apps/Settings/res/values/config.xml new file mode 100644 index 00000000..9219094f --- /dev/null +++ b/overlay-ice/packages/apps/Settings/res/values/config.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2007 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. +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- The number of vibration intensity levels supported by the device. + + Note that this should correspond to the ability to vary the vibration amplitude, with + enough dynamic range to have at least as many distinct intensity levels as defined here. + + Supported values are 1, 2, 3. If '1', the settings app will use a toggle for the settings, + otherwise a slider. If '3', the settings app maps intensities directly to the levels + supported by the Vibrator HAL APIs. If '2', then the levels will be mapped to + VIBRATION_INTENSITY_LOW and VIBRATION_INTENSITY_HIGH, which gives the most range for + scaling vibrations. The medium intensity will be skipped. + + The default intensity values are configured at + frameworks/base/core/res/res/values/config.xml's config_default[type]VibrationIntensity. + Make sure that each default intensity value is consistent with the supported levels set + here. If this settings supports only 2 levels, for example, then the default intensity + should be either LOW (1) or HIGH (3). + --> + <integer name="config_vibration_supported_intensity_levels">3</integer> +</resources> |