Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8779e0c9b7 | ||
|
|
3b57cb0e21 | ||
|
|
2e8813cff3 | ||
|
|
9e7d30109e | ||
|
|
6a757abc99 | ||
|
|
d4f9d673b0 | ||
|
|
c28c6d4069 | ||
|
|
5d17397ac7 | ||
|
|
58134fc19d | ||
|
|
bf7da37064 | ||
|
|
19a83c73a1 | ||
|
|
99c08b4e77 | ||
|
|
b6ff3d7cd7 | ||
|
|
0a0cc34354 | ||
|
|
df2974eefd | ||
|
|
57c743ec56 | ||
|
|
483836e95e | ||
|
|
df78b9324a | ||
|
|
ed12c16996 | ||
|
|
a5b9c1aaa5 | ||
|
|
e559d54d8f | ||
|
|
d6f0b19935 | ||
|
|
9834c8f80e | ||
|
|
1763d012e5 | ||
|
|
5e0fd308c3 | ||
|
|
0305e83275 | ||
|
|
d62096c187 | ||
|
|
4f438b9ae5 | ||
|
|
90c0306b75 | ||
|
|
c82f3f31fa | ||
|
|
f920f15040 | ||
|
|
71c471385e | ||
|
|
47750a4610 | ||
|
|
a8f34aa099 | ||
|
|
d13d47f8c3 | ||
|
|
c74487aa38 | ||
|
|
9e55a99e45 | ||
|
|
5b0f4d63f8 | ||
|
|
e3c118b877 | ||
|
|
b2d953cb26 | ||
|
|
7329a9d67c | ||
|
|
a750435b3e | ||
|
|
977f5036a4 | ||
|
|
13c7a39154 | ||
|
|
03ae5d3bc3 |
@@ -1,13 +0,0 @@
|
||||
BasedOnStyle: Google
|
||||
Standard: Cpp11
|
||||
AccessModifierOffset: -2
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: NOLINT:.*
|
||||
DerivePointerAlignment: false
|
||||
IncludeBlocks: Preserve
|
||||
IndentWidth: 4
|
||||
ContinuationIndentWidth: 8
|
||||
PointerAlignment: Left
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
1
.clang-format
Symbolic link
1
.clang-format
Symbolic link
@@ -0,0 +1 @@
|
||||
../../build/soong/scripts/system-clang-format
|
||||
13
.github/workflows/build/action.yml
vendored
13
.github/workflows/build/action.yml
vendored
@@ -1,13 +0,0 @@
|
||||
name: build
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pip install pre-commit
|
||||
|
||||
- name: Lint
|
||||
shell: bash
|
||||
run: pre-commit run --all
|
||||
38
.github/workflows/gerrit.yml
vendored
38
.github/workflows/gerrit.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: gerrit checks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
type: string
|
||||
gerrit-ref:
|
||||
type: string
|
||||
change:
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: lineageos-infra/fetch-gerrit-change@main
|
||||
with:
|
||||
gerrit-ref: ${{ inputs.gerrit-ref }}
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
- name: Check if build/action.yml exists
|
||||
id: check
|
||||
run: |
|
||||
if [ -f ./.github/workflows/build/action.yml ]; then
|
||||
echo "run=1" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
if: ${{ steps.check.outputs.run }}
|
||||
uses: ./.github/workflows/build
|
||||
|
||||
- uses: lineageos-infra/gerrit-vote@main
|
||||
if: ${{ steps.check.outputs.run && always() }}
|
||||
with:
|
||||
auth: ${{ secrets.GERRIT_VOTE_CREDS }}
|
||||
change: ${{ inputs.change }}
|
||||
ref: ${{ inputs.ref }}
|
||||
@@ -1,20 +0,0 @@
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v21.1.8
|
||||
hooks:
|
||||
- id: clang-format
|
||||
types_or: [c, c++]
|
||||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
||||
rev: v2.15.0
|
||||
hooks:
|
||||
- id: pretty-format-kotlin
|
||||
args: [--autofix, --ktfmt, --ktfmt-style=kotlinlang]
|
||||
41
Euicc/Android.bp
Normal file
41
Euicc/Android.bp
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright (C) 2023 The LineageOS Project
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
android_app {
|
||||
name: "XiaomiEuicc",
|
||||
|
||||
srcs: ["src/**/*.kt"],
|
||||
resource_dirs: ["res"],
|
||||
|
||||
sdk_version: "current",
|
||||
product_specific: true,
|
||||
certificate: "platform",
|
||||
privileged: true,
|
||||
|
||||
optimize: {
|
||||
proguard_flags_files: ["proguard.flags"],
|
||||
},
|
||||
required: [
|
||||
"co.aospa.euicc.xml",
|
||||
"hidden-api-whitelist-co.aospa.euicc.xml",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
sub_dir: "permissions",
|
||||
name: "co.aospa.euicc.xml",
|
||||
filename: "co.aospa.euicc.xml",
|
||||
src: "co.aospa.euicc.xml",
|
||||
product_specific: true,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
sub_dir: "sysconfig",
|
||||
name: "hidden-api-whitelist-co.aospa.euicc.xml",
|
||||
filename: "hidden-api-whitelist-co.aospa.euicc.xml",
|
||||
src: "hidden-api-whitelist-co.aospa.euicc.xml",
|
||||
product_specific: true,
|
||||
}
|
||||
42
Euicc/AndroidManifest.xml
Normal file
42
Euicc/AndroidManifest.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="co.aospa.euicc">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.google.android.gms" />
|
||||
<package android:name="com.google.android.gsf" />
|
||||
<package android:name="com.google.android.euicc" />
|
||||
<package android:name="com.google.android.ims" />
|
||||
</queries>
|
||||
|
||||
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />
|
||||
|
||||
<application
|
||||
android:persistent="true"
|
||||
android:usesNonSdkApi="true">
|
||||
<receiver
|
||||
android:exported="true"
|
||||
android:name=".BootCompletedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:directBootAware="true"
|
||||
android:exported="true"
|
||||
android:name=".EuiccReceiver"
|
||||
android:permission="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.euicc.action.PARTNER_CUSTOMIZATION"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
7
Euicc/co.aospa.euicc.xml
Normal file
7
Euicc/co.aospa.euicc.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<permissions>
|
||||
<privapp-permissions package="co.aospa.euicc">
|
||||
<permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
|
||||
<permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"/>
|
||||
</privapp-permissions>
|
||||
</permissions>
|
||||
4
Euicc/hidden-api-whitelist-co.aospa.euicc.xml
Normal file
4
Euicc/hidden-api-whitelist-co.aospa.euicc.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<hidden-api-whitelisted-app package="co.aospa.euicc" />
|
||||
</config>
|
||||
3
Euicc/proguard.flags
Normal file
3
Euicc/proguard.flags
Normal file
@@ -0,0 +1,3 @@
|
||||
-keep class co.aospa.euicc.* {
|
||||
*;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
9
Euicc/res/values/strings.xml
Normal file
9
Euicc/res/values/strings.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources>
|
||||
<string name="sim_illustration_lottie_mappings_json">{\"sim_illustration_lottie_mappings\":[{\"devices\":[\"diting\"],\"illustration_lottie\":\"sim_illustration_lottie_bottom\"}]}</string>
|
||||
<string name="sim_slot_mappings_json">{\"sim-slot-mappings\":[{\"devices\":[\"diting\"],\"esim-slot-ids\":[1],\"psim-slot-ids\":[0]}]}</string>
|
||||
</resources>
|
||||
22
Euicc/src/co/aospa/euicc/BootCompletedReceiver.kt
Normal file
22
Euicc/src/co/aospa/euicc/BootCompletedReceiver.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package co.aospa.euicc
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
|
||||
class BootCompletedReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
Log.d(TAG, "Received boot completed intent")
|
||||
EuiccDisabler.enableOrDisableEuicc(context)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "XiaomiEuiccBootReceiver"
|
||||
}
|
||||
}
|
||||
53
Euicc/src/co/aospa/euicc/EuiccDisabler.kt
Normal file
53
Euicc/src/co/aospa/euicc/EuiccDisabler.kt
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package co.aospa.euicc
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.PackageManager.ApplicationInfoFlags
|
||||
import android.util.Log
|
||||
|
||||
object EuiccDisabler {
|
||||
private const val TAG = "XiaomiEuiccDisabler"
|
||||
|
||||
private val EUICC_DEPENDENCIES = listOf(
|
||||
"com.google.android.gms",
|
||||
"com.google.android.gsf",
|
||||
)
|
||||
|
||||
private val EUICC_PACKAGES = listOf(
|
||||
"com.google.android.euicc",
|
||||
"com.google.android.ims",
|
||||
)
|
||||
|
||||
private fun isInstalled(pm: PackageManager, pkgName: String) = runCatching {
|
||||
val info = pm.getApplicationInfo(pkgName, ApplicationInfoFlags.of(0))
|
||||
info.flags and ApplicationInfo.FLAG_INSTALLED != 0
|
||||
}.getOrDefault(false)
|
||||
|
||||
private fun isInstalledAndEnabled(pm: PackageManager, pkgName: String) = runCatching {
|
||||
val info = pm.getApplicationInfo(pkgName, ApplicationInfoFlags.of(0))
|
||||
Log.d(TAG, "package $pkgName installed, enabled = ${info.enabled}")
|
||||
info.enabled
|
||||
}.getOrDefault(false)
|
||||
|
||||
fun enableOrDisableEuicc(context: Context) {
|
||||
val pm = context.packageManager
|
||||
val disable = EUICC_DEPENDENCIES.any { !isInstalledAndEnabled(pm, it) }
|
||||
val flag = if (disable) {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
} else {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
}
|
||||
|
||||
for (pkg in EUICC_PACKAGES) {
|
||||
if (isInstalled(pm, pkg)) {
|
||||
pm.setApplicationEnabledSetting(pkg, flag, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Euicc/src/co/aospa/euicc/EuiccReceiver.kt
Normal file
21
Euicc/src/co/aospa/euicc/EuiccReceiver.kt
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package co.aospa.euicc
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
|
||||
class EuiccReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
Log.d(TAG, "Received PARTNER_CUSTOMIZATION intent")
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "XiaomiEuiccReceiver"
|
||||
}
|
||||
}
|
||||
183
IFAAService/src/org/ifaa/aidl/manager/IfaaService.kt
Normal file
183
IFAAService/src/org/ifaa/aidl/manager/IfaaService.kt
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.ifaa.aidl.manager
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IHwBinder
|
||||
import android.os.SystemProperties
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import org.ifaa.aidl.manager.IfaaManagerService
|
||||
import org.json.JSONObject
|
||||
import vendor.xiaomi.hardware.mlipay.V1_1.IMlipayService
|
||||
|
||||
class IfaaService : Service() {
|
||||
private var _mlipayService: IMlipayService? = null
|
||||
|
||||
private val mlipayServiceDeathRecipient = IHwBinder.DeathRecipient {
|
||||
Log.i(LOG_TAG, "mlipay service died")
|
||||
_mlipayService = null
|
||||
}
|
||||
|
||||
private val mBinder = object : IfaaManagerService.Stub() {
|
||||
override fun getSupportBIOTypes(): Int {
|
||||
val fpVendor = SystemProperties.get(FP_VENDOR_PROP, "")
|
||||
val isUdfps = SystemProperties.getBoolean(IS_UDFPS_PROP, false)
|
||||
|
||||
val supportedBioMask = when (!invalidFpVendors.contains(fpVendor.lowercase())) {
|
||||
true -> AUTH_TYPE_FINGERPRINT or AUTH_TYPE_IRIS
|
||||
else -> AUTH_TYPE_IRIS
|
||||
}
|
||||
|
||||
val ifaaProp = SystemProperties.getInt(
|
||||
SUPPORTED_BIO_MASK_PROP, 0
|
||||
) and supportedBioMask or when (isUdfps) {
|
||||
true -> AUTH_TYPE_OPTICAL_FINGERPRINT
|
||||
else -> 0
|
||||
}
|
||||
|
||||
return ifaaProp
|
||||
}
|
||||
|
||||
override fun startBIOManager(authType: Int) = when (authType) {
|
||||
AUTH_TYPE_FINGERPRINT -> {
|
||||
val intent = Intent(Settings.ACTION_SECURITY_SETTINGS).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
|
||||
applicationContext.startActivity(intent)
|
||||
|
||||
COMMAND_OK
|
||||
}
|
||||
|
||||
else -> COMMAND_FAIL
|
||||
}
|
||||
|
||||
override fun getDeviceModel() = "${Build.MANUFACTURER}-${Build.DEVICE}"
|
||||
|
||||
override fun processCmd(param: ByteArray) = getMlipayService()?.let { mlipayService ->
|
||||
var receiveBuffer: ByteArray? = null
|
||||
|
||||
val paramByteArray = ArrayList<Byte>().apply {
|
||||
for (byte in param) {
|
||||
add(byte)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
val receiveBufferByteArray = mlipayService.invoke_command(
|
||||
paramByteArray, paramByteArray.size
|
||||
)
|
||||
|
||||
receiveBuffer = receiveBufferByteArray.toByteArray()
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "processCmdImpl: mlipay invoke_command failed", e)
|
||||
}
|
||||
|
||||
receiveBuffer
|
||||
}
|
||||
|
||||
override fun getVersion() = 4
|
||||
|
||||
override fun getExtInfo(authType: Int, keyExtInfo: String) = initExtString()
|
||||
|
||||
override fun setExtInfo(authType: Int, keyExtInfo: String, valExtInfo: String) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
override fun getEnabled(bioType: Int) = when (bioType) {
|
||||
AUTH_TYPE_FINGERPRINT -> BIOMETRICS_AVAILABLE
|
||||
else -> SCREEN_LOCK_NONE
|
||||
}
|
||||
|
||||
override fun getIDList(bioType: Int): IntArray {
|
||||
var idList = IntArray(0)
|
||||
|
||||
getMlipayService()?.let { mlipayService ->
|
||||
try {
|
||||
val idListAL = mlipayService.ifaa_get_idlist(bioType)
|
||||
|
||||
idList = idListAL.toIntArray()
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "getIDListImpl: mlipay ifaa_get_idlist failed", e)
|
||||
}
|
||||
}
|
||||
|
||||
return idList
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent) = mBinder
|
||||
|
||||
private fun getMlipayService() = _mlipayService ?: runCatching {
|
||||
IMlipayService.getService(true)
|
||||
}.onSuccess {
|
||||
_mlipayService = it
|
||||
it.linkToDeath(mlipayServiceDeathRecipient, 0)
|
||||
}.getOrNull()
|
||||
|
||||
private fun initExtString(): String {
|
||||
val obj = JSONObject()
|
||||
val keyInfo = JSONObject()
|
||||
|
||||
val xy = SystemProperties.get(UDFPS_LOCATION_X_Y_PROP, "")
|
||||
val wh = SystemProperties.get(UDFPS_SIZE_W_H_PROP, "")
|
||||
|
||||
try {
|
||||
if (!validateVal(xy) || !validateVal(wh)) {
|
||||
Log.e(LOG_TAG, "initExtString: invalidate, xy: $xy, wh: $wh")
|
||||
return ""
|
||||
}
|
||||
|
||||
val split = xy.split(",")
|
||||
val split2 = wh.split(",")
|
||||
|
||||
keyInfo.put("startX", split[0].toInt())
|
||||
keyInfo.put("startY", split[1].toInt())
|
||||
keyInfo.put("width", split2[0].toInt())
|
||||
keyInfo.put("height", split2[1].toInt())
|
||||
keyInfo.put("navConflict", true)
|
||||
|
||||
obj.put("type", 0)
|
||||
obj.put("fullView", keyInfo)
|
||||
|
||||
return obj.toString()
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "initExtString: Exception, xy: $xy, wh: $wh", e)
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
private fun validateVal(str: String) = !"".equals(str, ignoreCase = true) && str.contains(",")
|
||||
|
||||
companion object {
|
||||
private val LOG_TAG = IfaaService::class.simpleName!!
|
||||
|
||||
private const val AUTH_TYPE_NOT_SUPPORT = 0
|
||||
private const val AUTH_TYPE_FINGERPRINT = 1
|
||||
private const val AUTH_TYPE_IRIS = 1.shl(1)
|
||||
private const val AUTH_TYPE_OPTICAL_FINGERPRINT = 1.shl(2)
|
||||
|
||||
private const val BIOMETRICS_AVAILABLE = 1000
|
||||
private const val SCREEN_LOCK_NONE = 1003
|
||||
|
||||
private const val COMMAND_OK = 0
|
||||
private const val COMMAND_FAIL = -1
|
||||
|
||||
private const val SUPPORTED_BIO_MASK_PROP = "persist.vendor.sys.pay.ifaa"
|
||||
private const val FP_VENDOR_PROP = "persist.vendor.sys.fp.vendor"
|
||||
private const val IS_UDFPS_PROP = "ro.hardware.fp.udfps"
|
||||
private const val UDFPS_LOCATION_X_Y_PROP = "persist.vendor.sys.fp.udfps.location.X_Y"
|
||||
private const val UDFPS_SIZE_W_H_PROP = "persist.vendor.sys.fp.udfps.size.width_height"
|
||||
|
||||
private val invalidFpVendors = arrayOf(
|
||||
"",
|
||||
"none",
|
||||
)
|
||||
}
|
||||
}
|
||||
10
README.md
10
README.md
@@ -1,10 +0,0 @@
|
||||
# hardware/xiaomi
|
||||
|
||||
## Soong options
|
||||
|
||||
| Namespace | Variable | Description | Default |
|
||||
| --------- | -------- | ----------- | ------- |
|
||||
| XIAOMI_BIOMETRICS_FINGERPRINT | RUN_32BIT | Opt to run service in 32-bit mode only | false |
|
||||
| XIAOMI_TOUCH | HIGH_TOUCH_POLLING_PATH | HighTouchPollingRate feature control path | |
|
||||
| XIAOMI_TOUCH | KEY_DISABLER_CONTROL_PATH | KeyDisabler feature control path | |
|
||||
| XIAOMI_TOUCH | KEY_SWAPPER_CONTROL_PATH | KeySwapper feature control path | |
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (C) 2024-2025 The LineageOS Project
|
||||
// Copyright (C) 2024 The LineageOS Project
|
||||
// 2024 Paranoid Android
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
@@ -8,9 +8,9 @@
|
||||
soong_config_module_type {
|
||||
name: "xiaomi_hardware_biometrics_config_default",
|
||||
module_type: "cc_defaults",
|
||||
config_namespace: "XIAOMI_BIOMETRICS_FINGERPRINT",
|
||||
config_namespace: "xiaomi_hardware_biometrics",
|
||||
bool_variables: [
|
||||
"RUN_32BIT",
|
||||
"run_32bit",
|
||||
],
|
||||
properties: ["compile_multilib"],
|
||||
}
|
||||
@@ -19,7 +19,7 @@ xiaomi_hardware_biometrics_config_default {
|
||||
name: "xiaomi_hardware_biometrics_config_default",
|
||||
|
||||
soong_config_variables: {
|
||||
RUN_32BIT: {
|
||||
run_32bit: {
|
||||
conditions_default: {
|
||||
compile_multilib: "64",
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* 2024 Paranoid Android
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
@@ -12,11 +12,8 @@
|
||||
#include "util/Util.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
using ::android::base::SetProperty;
|
||||
|
||||
namespace aidl::android::hardware::biometrics::fingerprint {
|
||||
|
||||
namespace {
|
||||
@@ -70,19 +67,15 @@ Fingerprint::Fingerprint(std::shared_ptr<FingerprintConfig> config) : mConfig(st
|
||||
}
|
||||
ALOGI("Opened fingerprint HAL, class: %s, module_id: %s", class_name.c_str(),
|
||||
class_module_id.c_str());
|
||||
SetProperty("persist.vendor.sys.fp.vendor", class_name);
|
||||
break;
|
||||
}
|
||||
if (!mDevice) {
|
||||
ALOGE("Can't open any fingerprint HAL module");
|
||||
SetProperty("persist.vendor.sys.fp.vendor", "none");
|
||||
}
|
||||
}
|
||||
|
||||
std::string sensorTypeProp = mConfig->get<std::string>("type");
|
||||
if (sensorTypeProp == "udfps" || sensorTypeProp == "udfps_optical") {
|
||||
SetProperty("ro.hardware.fp.udfps", "true");
|
||||
|
||||
if (sensorTypeProp == "udfps") {
|
||||
mSensorType = FingerprintSensorType::UNDER_DISPLAY_ULTRASONIC;
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -364,15 +364,9 @@ void Session::notify(const fingerprint_msg_t* msg) {
|
||||
HardwareAuthToken authToken;
|
||||
translate(hat, authToken);
|
||||
|
||||
if (mUdfpsHandler) {
|
||||
mUdfpsHandler->onAuthenticationSucceeded();
|
||||
}
|
||||
mCb->onAuthenticationSucceeded(msg->data.authenticated.finger.fid, authToken);
|
||||
mLockoutTracker.reset(true);
|
||||
} else {
|
||||
if (mUdfpsHandler) {
|
||||
mUdfpsHandler->onAuthenticationFailed();
|
||||
}
|
||||
mCb->onAuthenticationFailed();
|
||||
mLockoutTracker.addFailedAttempt();
|
||||
checkSensorLockout();
|
||||
|
||||
@@ -5,6 +5,5 @@ service vendor.fingerprint-default /vendor/bin/hw/android.hardware.biometrics.fi
|
||||
class late_start
|
||||
user system
|
||||
group system input uhid
|
||||
capabilities SYS_NICE
|
||||
shutdown critical
|
||||
task_profiles ProcessCapacityHigh MaxPerformance
|
||||
|
||||
21
aidl/ir/Android.bp
Normal file
21
aidl/ir/Android.bp
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.ir-service.xiaomi",
|
||||
relative_install_path: "hw",
|
||||
vendor: true,
|
||||
init_rc: ["android.hardware.ir-service.xiaomi.rc"],
|
||||
vintf_fragments: ["android.hardware.ir-service.xiaomi.xml"],
|
||||
srcs: [
|
||||
"ConsumerIr.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"android.hardware.ir-V1-ndk",
|
||||
],
|
||||
}
|
||||
80
aidl/ir/ConsumerIr.cpp
Normal file
80
aidl/ir/ConsumerIr.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "ConsumerIr"
|
||||
|
||||
#include "ConsumerIr.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/lirc.h>
|
||||
#include <string>
|
||||
|
||||
using std::vector;
|
||||
|
||||
namespace aidl {
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace ir {
|
||||
|
||||
static const std::string kIrDevice = "/dev/lirc0";
|
||||
|
||||
static vector<ConsumerIrFreqRange> kRangeVec{
|
||||
{.minHz = 30000, .maxHz = 60000},
|
||||
};
|
||||
|
||||
::ndk::ScopedAStatus ConsumerIr::getCarrierFreqs(vector<ConsumerIrFreqRange>* _aidl_return) {
|
||||
*_aidl_return = kRangeVec;
|
||||
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus ConsumerIr::transmit(int32_t carrierFreqHz, const vector<int32_t>& pattern) {
|
||||
size_t entries = pattern.size();
|
||||
|
||||
if (entries == 0) {
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
int fd = open(kIrDevice.c_str(), O_RDWR);
|
||||
if (fd < 0) {
|
||||
LOG(ERROR) << "Failed to open " << kIrDevice << ", error " << fd;
|
||||
|
||||
return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
|
||||
}
|
||||
|
||||
int rc = ioctl(fd, LIRC_SET_SEND_CARRIER, &carrierFreqHz);
|
||||
if (rc < 0) {
|
||||
LOG(ERROR) << "Failed to set carrier " << carrierFreqHz << ", error: " << errno;
|
||||
|
||||
close(fd);
|
||||
|
||||
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
if ((entries & 1) != 0) {
|
||||
rc = write(fd, pattern.data(), entries * sizeof(int32_t));
|
||||
} else {
|
||||
rc = write(fd, pattern.data(), (entries - 1) * sizeof(int32_t));
|
||||
usleep(pattern[entries - 1]);
|
||||
}
|
||||
|
||||
if (rc < 0) {
|
||||
LOG(ERROR) << "Failed to write pattern, " << entries << " entries, error: " << errno;
|
||||
|
||||
close(fd);
|
||||
|
||||
return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
} // namespace ir
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
} // namespace aidl
|
||||
27
aidl/ir/ConsumerIr.h
Normal file
27
aidl/ir/ConsumerIr.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <aidl/android/hardware/ir/BnConsumerIr.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace ir {
|
||||
|
||||
class ConsumerIr : public BnConsumerIr {
|
||||
public:
|
||||
::ndk::ScopedAStatus getCarrierFreqs(
|
||||
::std::vector<::aidl::android::hardware::ir::ConsumerIrFreqRange>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus transmit(int32_t carrierFreqHz,
|
||||
const ::std::vector<int32_t>& pattern) override;
|
||||
};
|
||||
|
||||
} // namespace ir
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
} // namespace aidl
|
||||
14
aidl/ir/android.hardware.ir-service.xiaomi.rc
Normal file
14
aidl/ir/android.hardware.ir-service.xiaomi.rc
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
on early-boot
|
||||
# IR device
|
||||
chown system system /dev/lirc0
|
||||
|
||||
service vendor.ir-default /vendor/bin/hw/android.hardware.ir-service.xiaomi
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
shutdown critical
|
||||
11
aidl/ir/android.hardware.ir-service.xiaomi.xml
Normal file
11
aidl/ir/android.hardware.ir-service.xiaomi.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.ir</name>
|
||||
<version>1</version>
|
||||
<fqname>IConsumerIr/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
24
aidl/ir/service.cpp
Normal file
24
aidl/ir/service.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "ConsumerIr.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
|
||||
using aidl::android::hardware::ir::ConsumerIr;
|
||||
|
||||
int main() {
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
||||
std::shared_ptr<ConsumerIr> hal = ::ndk::SharedRefBase::make<ConsumerIr>();
|
||||
|
||||
const std::string instance = std::string(ConsumerIr::descriptor) + "/default";
|
||||
binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK);
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
||||
@@ -19,12 +19,6 @@ package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
vintf_fragment {
|
||||
name: "android.hardware.sensors.xiaomi-multihal.xml",
|
||||
src: "android.hardware.sensors.xiaomi-multihal.xml",
|
||||
vendor: true,
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.sensors-service.xiaomi-multihal",
|
||||
vendor: true,
|
||||
@@ -39,12 +33,12 @@ cc_binary {
|
||||
"android.hardware.sensors@2.X-shared-utils",
|
||||
],
|
||||
init_rc: ["android.hardware.sensors-service.xiaomi-multihal.rc"],
|
||||
vintf_fragment_modules: ["android.hardware.sensors.xiaomi-multihal.xml"],
|
||||
vintf_fragments: ["android.hardware.sensors.xiaomi-multihal.xml"],
|
||||
shared_libs: [
|
||||
"android.hardware.sensors@2.0-ScopedWakelock",
|
||||
"android.hardware.sensors@2.0",
|
||||
"android.hardware.sensors@2.1",
|
||||
"android.hardware.sensors-V3-ndk",
|
||||
"android.hardware.sensors-V2-ndk",
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libfmq",
|
||||
|
||||
@@ -147,9 +147,9 @@ Return<void> HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _h
|
||||
Return<void> HalProxy::getSensorsList(ISensorsV2_0::getSensorsList_cb _hidl_cb) {
|
||||
std::vector<V1_0::SensorInfo> sensors;
|
||||
for (const auto& iter : mSensors) {
|
||||
if (iter.second.type != SensorType::HINGE_ANGLE) {
|
||||
sensors.push_back(convertToOldSensorInfo(iter.second));
|
||||
}
|
||||
if (iter.second.type != SensorType::HINGE_ANGLE) {
|
||||
sensors.push_back(convertToOldSensorInfo(iter.second));
|
||||
}
|
||||
}
|
||||
_hidl_cb(sensors);
|
||||
return Void();
|
||||
@@ -612,8 +612,7 @@ void HalProxy::handlePendingWrites() {
|
||||
static_cast<uint32_t>(EventQueueFlagBits::EVENTS_READ),
|
||||
static_cast<uint32_t>(EventQueueFlagBits::READ_AND_PROCESS),
|
||||
kPendingWriteTimeoutNs, mEventQueueFlag)) {
|
||||
ALOGE("Dropping %zu events after blockingWrite failed (is system_server running?).",
|
||||
numToWrite);
|
||||
ALOGE("Dropping %zu events after blockingWrite failed.", numToWrite);
|
||||
if (numWakeupEvents > 0) {
|
||||
if (pendingWriteEvents.size() > eventQueueSize) {
|
||||
decrementRefCountAndMaybeReleaseWakelock(
|
||||
@@ -736,7 +735,8 @@ void HalProxy::decrementRefCountAndMaybeReleaseWakelock(size_t delta,
|
||||
if (!mThreadsRun.load()) return;
|
||||
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
|
||||
if (delta > mWakelockRefCount) {
|
||||
ALOGE("Decrementing wakelock ref count by %zu when count is %zu", delta, mWakelockRefCount);
|
||||
ALOGE("Decrementing wakelock ref count by %zu when count is %zu",
|
||||
delta, mWakelockRefCount);
|
||||
}
|
||||
if (timeoutStart == -1) timeoutStart = mWakelockTimeoutResetTime;
|
||||
if (mWakelockRefCount == 0 || timeoutStart < mWakelockTimeoutResetTime) return;
|
||||
|
||||
@@ -74,7 +74,8 @@ std::vector<V2_1::Event> HalProxyCallbackBase::processEvents(const std::vector<V
|
||||
}
|
||||
const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
|
||||
|
||||
if (sensor.type == V2_1::SensorType::PICK_UP_GESTURE && event.u.scalar != 1) {
|
||||
if (sensor.type == V2_1::SensorType::PICK_UP_GESTURE
|
||||
&& event.u.scalar != 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
on boot
|
||||
setprop vendor.sensors.dynamic_sensor_op_timeout_ms 1600
|
||||
|
||||
service vendor.sensors-hal-multihal /vendor/bin/hw/android.hardware.sensors-service.xiaomi-multihal
|
||||
class hal
|
||||
user system
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.sensors</name>
|
||||
<version>3</version>
|
||||
<version>2</version>
|
||||
<fqname>ISensors/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
cc_binary {
|
||||
name: "vendor.lineage.touch-service.xiaomi",
|
||||
init_rc: ["vendor.lineage.touch-service.xiaomi.rc"],
|
||||
vintf_fragments: select(soong_config_variable("XIAOMI_TOUCH", "HIGH_TOUCH_POLLING_PATH"), {
|
||||
any: ["vendor.lineage.touch-service.xiaomi-htpr.xml"],
|
||||
default: [],
|
||||
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_DISABLER_CONTROL_PATH"), {
|
||||
any: ["vendor.lineage.touch-service.xiaomi-kd.xml"],
|
||||
default: [],
|
||||
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_SWAPPER_CONTROL_PATH"), {
|
||||
any: ["vendor.lineage.touch-service.xiaomi-ks.xml"],
|
||||
default: [],
|
||||
}),
|
||||
relative_install_path: "hw",
|
||||
proprietary: true,
|
||||
cppflags: select(soong_config_variable("XIAOMI_TOUCH", "HIGH_TOUCH_POLLING_PATH"), {
|
||||
any @ flag_val: ["-DHTPR_CONTROL_PATH=\"" + flag_val + "\""],
|
||||
default: [],
|
||||
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_DISABLER_CONTROL_PATH"), {
|
||||
any @ flag_val: ["-DKD_CONTROL_PATH=\"" + flag_val + "\""],
|
||||
default: [],
|
||||
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_SWAPPER_CONTROL_PATH"), {
|
||||
any @ flag_val: ["-DKS_CONTROL_PATH=\"" + flag_val + "\""],
|
||||
default: [],
|
||||
}),
|
||||
srcs: select(soong_config_variable("XIAOMI_TOUCH", "HIGH_TOUCH_POLLING_PATH"), {
|
||||
any: ["HighTouchPollingRate.cpp"],
|
||||
default: [],
|
||||
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_DISABLER_CONTROL_PATH"), {
|
||||
any: ["KeyDisabler.cpp"],
|
||||
default: [],
|
||||
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_SWAPPER_CONTROL_PATH"), {
|
||||
any: ["KeySwapper.cpp"],
|
||||
default: [],
|
||||
}) + ["service.cpp"],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"liblog",
|
||||
"libutils",
|
||||
"vendor.lineage.touch-V1-ndk",
|
||||
],
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
|
||||
|
||||
#include "HighTouchPollingRate.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
using ::android::base::ReadFileToString;
|
||||
using ::android::base::Trim;
|
||||
using ::android::base::WriteStringToFile;
|
||||
|
||||
namespace aidl {
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
|
||||
ndk::ScopedAStatus HighTouchPollingRate::getEnabled(bool* _aidl_return) {
|
||||
std::string buf;
|
||||
if (!ReadFileToString(HTPR_CONTROL_PATH, &buf)) {
|
||||
LOG(ERROR) << "Failed to read current HighTouchPollingRate state";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
*_aidl_return = Trim(buf) == "1";
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus HighTouchPollingRate::setEnabled(bool enabled) {
|
||||
if (!WriteStringToFile(enabled ? "1" : "0", HTPR_CONTROL_PATH)) {
|
||||
LOG(ERROR) << "Failed to write HighTouchPollingRate state";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
} // namespace aidl
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <aidl/vendor/lineage/touch/BnHighTouchPollingRate.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
|
||||
class HighTouchPollingRate : public BnHighTouchPollingRate {
|
||||
public:
|
||||
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
|
||||
ndk::ScopedAStatus setEnabled(bool enabled) override;
|
||||
};
|
||||
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
} // namespace aidl
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
|
||||
|
||||
#include "KeyDisabler.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
using ::android::base::ReadFileToString;
|
||||
using ::android::base::Trim;
|
||||
using ::android::base::WriteStringToFile;
|
||||
|
||||
namespace aidl {
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
|
||||
ndk::ScopedAStatus KeyDisabler::getEnabled(bool* _aidl_return) {
|
||||
std::string buf;
|
||||
if (!ReadFileToString(KD_CONTROL_PATH, &buf)) {
|
||||
LOG(ERROR) << "Failed to read current KeyDisabler state";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
*_aidl_return = Trim(buf) == "0";
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus KeyDisabler::setEnabled(bool enabled) {
|
||||
if (!WriteStringToFile(enabled ? "0" : "1", KD_CONTROL_PATH, true)) {
|
||||
LOG(ERROR) << "Failed to write KeyDisabler state";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
} // namespace aidl
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <aidl/vendor/lineage/touch/BnKeyDisabler.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
|
||||
class KeyDisabler : public BnKeyDisabler {
|
||||
public:
|
||||
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
|
||||
ndk::ScopedAStatus setEnabled(bool enabled) override;
|
||||
};
|
||||
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
} // namespace aidl
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
|
||||
|
||||
#include "KeySwapper.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
using ::android::base::ReadFileToString;
|
||||
using ::android::base::Trim;
|
||||
using ::android::base::WriteStringToFile;
|
||||
|
||||
namespace aidl {
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
|
||||
ndk::ScopedAStatus KeySwapper::getEnabled(bool* _aidl_return) {
|
||||
std::string buf;
|
||||
if (!ReadFileToString(KS_CONTROL_PATH, &buf)) {
|
||||
LOG(ERROR) << "Failed to read current KeySwapper state";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
*_aidl_return = Trim(buf) == "1";
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus KeySwapper::setEnabled(bool enabled) {
|
||||
if (!WriteStringToFile(enabled ? "1" : "0", KS_CONTROL_PATH, true)) {
|
||||
LOG(ERROR) << "Failed to write KeySwapper state";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
} // namespace aidl
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <aidl/vendor/lineage/touch/BnKeySwapper.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
|
||||
class KeySwapper : public BnKeySwapper {
|
||||
public:
|
||||
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
|
||||
ndk::ScopedAStatus setEnabled(bool enabled) override;
|
||||
};
|
||||
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
} // namespace aidl
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
|
||||
|
||||
#include "HighTouchPollingRate.h"
|
||||
#include "KeyDisabler.h"
|
||||
#include "KeySwapper.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
|
||||
using aidl::vendor::lineage::touch::HighTouchPollingRate;
|
||||
using aidl::vendor::lineage::touch::KeyDisabler;
|
||||
using aidl::vendor::lineage::touch::KeySwapper;
|
||||
|
||||
int main() {
|
||||
binder_status_t status = STATUS_OK;
|
||||
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
||||
|
||||
#ifdef HTPR_CONTROL_PATH
|
||||
std::shared_ptr<HighTouchPollingRate> htpr = ndk::SharedRefBase::make<HighTouchPollingRate>();
|
||||
const std::string htpr_instance = std::string(HighTouchPollingRate::descriptor) + "/default";
|
||||
status = AServiceManager_addService(htpr->asBinder().get(), htpr_instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK) << "Failed to add service " << htpr_instance << " " << status;
|
||||
#endif
|
||||
|
||||
#ifdef KD_CONTROL_PATH
|
||||
std::shared_ptr<KeyDisabler> kd = ndk::SharedRefBase::make<KeyDisabler>();
|
||||
const std::string kd_instance = std::string(KeyDisabler::descriptor) + "/default";
|
||||
status = AServiceManager_addService(kd->asBinder().get(), kd_instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK) << "Failed to add service " << kd_instance << " " << status;
|
||||
#endif
|
||||
|
||||
#ifdef KS_CONTROL_PATH
|
||||
std::shared_ptr<KeySwapper> ks = ndk::SharedRefBase::make<KeySwapper>();
|
||||
const std::string ks_instance = std::string(KeySwapper::descriptor) + "/default";
|
||||
status = AServiceManager_addService(ks->asBinder().get(), ks_instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK) << "Failed to add service " << ks_instance << " " << status;
|
||||
#endif
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>vendor.lineage.touch</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IKeyDisabler</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
@@ -1,10 +0,0 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>vendor.lineage.touch</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IKeySwapper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
@@ -1,4 +0,0 @@
|
||||
service vendor.touch-hal /vendor/bin/hw/vendor.lineage.touch-service.xiaomi
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
@@ -10,8 +10,7 @@
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<application
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:allowBackup="false"
|
||||
android:allowBackup="true"
|
||||
android:label="@string/dolby_title"
|
||||
android:persistent="true">
|
||||
|
||||
@@ -26,7 +25,7 @@
|
||||
<activity
|
||||
android:name=".DolbyActivity"
|
||||
android:label="@string/dolby_title"
|
||||
android:theme="@style/Theme.SubSettingsBase.Expressive"
|
||||
android:theme="@style/Theme.SubSettingsBase"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
@@ -37,10 +36,6 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.CATEGORY_CONTENT_MUSIC" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<meta-data android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.sound" />
|
||||
<meta-data android:name="com.android.settings.summary_uri"
|
||||
@@ -50,7 +45,7 @@
|
||||
<activity
|
||||
android:name=".geq.EqualizerActivity"
|
||||
android:label="@string/dolby_preset"
|
||||
android:theme="@style/Theme.SubSettingsBase.Expressive"
|
||||
android:theme="@style/Theme.SubSettingsBase"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector android:height="108.0dip" android:width="108.0dip" android:viewportWidth="108.0" android:viewportHeight="108.0"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<group android:scaleX="1.3544992" android:scaleY="1.3544992" android:translateX="-23.22" android:translateY="-23.22">
|
||||
<group>
|
||||
<clip-path android:pathData="M57.01,57.01m-54,0a54,54 0,1 1,108 0a54,54 0,1 1,-108 0" />
|
||||
<path android:fillColor="#ffeaedef" android:pathData="M-1.9,-1.9h117.82v117.82h-117.82z" />
|
||||
<path android:fillColor="@drawable/ic_launcher_background__0" android:pathData="M-1.9,115.92l0,-117.82l117.82,0l-117.82,117.82z" />
|
||||
<path android:fillColor="@drawable/ic_launcher_background__1" android:pathData="M-1.9,-1.9h117.82v117.82h-117.82z" android:strokeAlpha="0.2" android:fillAlpha="0.2" />
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<gradient android:angle="0.0" android:type="linear" android:startX="57.01" android:startY="56.4" android:endX="57.01" android:endY="-1.58"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<item android:color="#ffffffff" android:offset="0.0" />
|
||||
<item android:color="#fff3f5f6" android:offset="1.0" />
|
||||
</gradient>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<gradient android:angle="0.0" android:type="linear" android:startX="-1.9" android:startY="115.92" android:endX="115.92" android:endY="-1.9"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<item android:color="#ff80d0ce" android:offset="0.0" />
|
||||
<item android:color="#ff9fa8da" android:offset="1.0" />
|
||||
</gradient>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector android:height="108.0dip" android:width="108.0dip" android:viewportWidth="108.0" android:viewportHeight="108.0"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<group android:scaleX="0.84" android:scaleY="0.84" android:translateX="23.76" android:translateY="23.76">
|
||||
<path android:fillColor="#ff465461" android:pathData="M12,19.13h5a16.87,16.87 0,0 1,0 33.74H12Z" />
|
||||
<path android:fillColor="#ff465461" android:pathData="M60,52.87H55a16.87,16.87 0,0 1,0 -33.74h5Z" />
|
||||
</group>
|
||||
</vector>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="108dp" android:width="108dp" android:viewportWidth="108" android:viewportHeight="108">
|
||||
<path android:fillColor="#000000" android:pathData="M36.6305484,38 C45.6078241,38.1592687 52.837468,45.7082857 52.837468,54.9974325 C52.837468,64.2865794 45.6078241,71.8355964 36.6307694,71.9948651 L32,72 L32,38 L36.6305484,38 Z M36.999,43.017 L36.999,66.977 L37.1225728,66.9701894 C42.9872179,66.559014 47.6837958,61.5395304 47.8337726,55.3050128 L47.837468,54.9974325 C47.837468,48.6211219 43.0833381,43.4425908 37.1223719,43.0246757 L36.999,43.017 Z M71.3694516,38 C62.3921759,38.1592687 55.162532,45.7082857 55.162532,54.9974325 C55.162532,64.2865794 62.3921759,71.8355964 71.3692306,71.9948651 L76,72 L76,38 L71.3694516,38 Z M71.000532,43.017 L71.000532,66.977 L70.8774272,66.9701894 C65.0127821,66.559014 60.3162042,61.5395304 60.1662274,55.3050128 L60.162532,54.9974325 C60.162532,48.6211219 64.9166619,43.4425908 70.8776281,43.0246757 L71.000532,43.017 Z" android:strokeWidth="1"/>
|
||||
</vector>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_mono" />
|
||||
</adaptive-icon>
|
||||
@@ -10,16 +10,14 @@ import android.os.Bundle
|
||||
import co.aospa.dolby.xiaomi.preference.DolbySettingsFragment
|
||||
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
|
||||
|
||||
private const val TAG = "DolbyActivity"
|
||||
|
||||
class DolbyActivity : CollapsingToolbarBaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
.replace(
|
||||
com.android.settingslib.collapsingtoolbar.R.id.content_frame,
|
||||
DolbySettingsFragment(),
|
||||
)
|
||||
fragmentManager.beginTransaction()
|
||||
.replace(com.android.settingslib.collapsingtoolbar.R.id.content_frame, DolbySettingsFragment(), TAG)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ internal class DolbyController private constructor(
|
||||
private val context: Context
|
||||
) {
|
||||
private var dolbyEffect = DolbyAudioEffect(EFFECT_PRIORITY, audioSession = 0)
|
||||
private val audioManager = context.getSystemService(AudioManager::class.java)!!
|
||||
private val audioManager = context.getSystemService(AudioManager::class.java)
|
||||
private val handler = Handler(context.mainLooper)
|
||||
|
||||
// Restore current profile on every media session
|
||||
@@ -57,10 +57,10 @@ internal class DolbyController private constructor(
|
||||
field = value
|
||||
dlog(TAG, "setRegisterCallbacks($value)")
|
||||
if (value) {
|
||||
audioManager.registerAudioPlaybackCallback(playbackCallback, handler)
|
||||
audioManager!!.registerAudioPlaybackCallback(playbackCallback, handler)
|
||||
audioManager.registerAudioDeviceCallback(audioDeviceCallback, handler)
|
||||
} else {
|
||||
audioManager.unregisterAudioPlaybackCallback(playbackCallback)
|
||||
audioManager!!.unregisterAudioPlaybackCallback(playbackCallback)
|
||||
audioManager.unregisterAudioDeviceCallback(audioDeviceCallback)
|
||||
}
|
||||
}
|
||||
@@ -102,13 +102,13 @@ internal class DolbyController private constructor(
|
||||
dsOn = prefs.getBoolean(DolbyConstants.PREF_ENABLE, true)
|
||||
|
||||
context.resources.getStringArray(R.array.dolby_profile_values)
|
||||
.map { it.toInt() }
|
||||
.forEach { profile ->
|
||||
// Reset dolby first to prevent it from loading bad settings
|
||||
dolbyEffect.resetProfileSpecificSettings(profile)
|
||||
// Now restore our profile-specific settings
|
||||
restoreSettings(profile)
|
||||
}
|
||||
.map { it.toInt() }
|
||||
.forEach { profile ->
|
||||
// Reset dolby first to prevent it from loading bad settings
|
||||
dolbyEffect.resetProfileSpecificSettings(profile)
|
||||
// Now restore our profile-specific settings
|
||||
restoreSettings(profile)
|
||||
}
|
||||
|
||||
// Finally restore the current profile.
|
||||
setCurrentProfile()
|
||||
@@ -174,13 +174,6 @@ internal class DolbyController private constructor(
|
||||
profile = prefs.getString(DolbyConstants.PREF_PROFILE, "0" /*dynamic*/)!!.toInt()
|
||||
}
|
||||
|
||||
fun setDsOnAndPersist(dsOn: Boolean) {
|
||||
this.dsOn = dsOn
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit()
|
||||
.putBoolean(DolbyConstants.PREF_ENABLE, dsOn)
|
||||
.apply()
|
||||
}
|
||||
|
||||
fun getProfileName(): String? {
|
||||
val profile = dolbyEffect.profile.toString()
|
||||
val profiles = context.resources.getStringArray(R.array.dolby_profile_values)
|
||||
@@ -209,8 +202,8 @@ internal class DolbyController private constructor(
|
||||
dlog(TAG, "setPreset: $value")
|
||||
checkEffect()
|
||||
val gains = value.split(",")
|
||||
.map { it.toInt() }
|
||||
.toIntArray()
|
||||
.map { it.toInt() }
|
||||
.toIntArray()
|
||||
dolbyEffect.setDapParameter(DsParam.GEQ_BAND_GAINS, gains, profile)
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class DolbyTileService : TileService() {
|
||||
|
||||
override fun onClick() {
|
||||
val isDsOn = dolbyController.dsOn
|
||||
dolbyController.setDsOnAndPersist(!isDsOn) // toggle
|
||||
dolbyController.dsOn = !isDsOn
|
||||
qsTile.apply {
|
||||
state = if (isDsOn) Tile.STATE_INACTIVE else Tile.STATE_ACTIVE
|
||||
updateTile()
|
||||
|
||||
@@ -58,14 +58,13 @@ class SummaryProvider : ContentProvider() {
|
||||
): Int = 0
|
||||
|
||||
private fun getDolbySummary(): String {
|
||||
val context = context!!
|
||||
val dolbyController = DolbyController.getInstance(context)
|
||||
val dolbyController = DolbyController.getInstance(context!!)
|
||||
if (!dolbyController.dsOn) {
|
||||
return context.getString(R.string.dolby_off)
|
||||
return context!!.getString(R.string.dolby_off)
|
||||
}
|
||||
return dolbyController.getProfileName()?.let {
|
||||
context.getString(R.string.dolby_on_with_profile, it)
|
||||
} ?: context.getString(R.string.dolby_on)
|
||||
context!!.getString(R.string.dolby_on_with_profile, it)
|
||||
} ?: context!!.getString(R.string.dolby_on)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ fun TooltipIconButton(
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
TooltipBox(
|
||||
positionProvider = TooltipDefaults.rememberTooltipPositionProvider(),
|
||||
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
|
||||
tooltip = {
|
||||
Text(text)
|
||||
},
|
||||
|
||||
@@ -40,24 +40,24 @@ class DolbyPreferenceStore(
|
||||
|
||||
override fun putBoolean(key: String, value: Boolean) =
|
||||
getSharedPreferences(key).edit()
|
||||
.putBoolean(key, value)
|
||||
.apply()
|
||||
.putBoolean(key, value)
|
||||
.apply()
|
||||
|
||||
override fun getBoolean(key: String, defValue: Boolean) =
|
||||
getSharedPreferences(key).getBoolean(key, defValue)
|
||||
|
||||
override fun putInt(key: String, value: Int) =
|
||||
getSharedPreferences(key).edit()
|
||||
.putInt(key, value)
|
||||
.apply()
|
||||
.putInt(key, value)
|
||||
.apply()
|
||||
|
||||
override fun getInt(key: String, defValue: Int) =
|
||||
getSharedPreferences(key).getInt(key, defValue)
|
||||
|
||||
override fun putString(key: String, value: String?) =
|
||||
getSharedPreferences(key).edit()
|
||||
.putString(key, value)
|
||||
.apply()
|
||||
.putString(key, value)
|
||||
.apply()
|
||||
|
||||
override fun getString(key: String, defValue: String?) =
|
||||
getSharedPreferences(key).getString(key, defValue)
|
||||
|
||||
@@ -6,20 +6,20 @@
|
||||
|
||||
package co.aospa.dolby.xiaomi.preference
|
||||
|
||||
import android.content.Context
|
||||
import android.media.AudioAttributes
|
||||
import android.media.AudioDeviceCallback
|
||||
import android.media.AudioDeviceInfo
|
||||
import android.media.AudioManager
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.View
|
||||
import android.widget.CompoundButton
|
||||
import android.widget.Toast
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener
|
||||
import androidx.preference.PreferenceFragment
|
||||
import androidx.preference.SwitchPreferenceCompat
|
||||
import co.aospa.dolby.xiaomi.DolbyConstants
|
||||
import co.aospa.dolby.xiaomi.DolbyConstants.Companion.PREF_BASS
|
||||
import co.aospa.dolby.xiaomi.DolbyConstants.Companion.PREF_DIALOGUE
|
||||
import co.aospa.dolby.xiaomi.DolbyConstants.Companion.PREF_ENABLE
|
||||
@@ -35,33 +35,47 @@ import co.aospa.dolby.xiaomi.DolbyConstants.Companion.dlog
|
||||
import co.aospa.dolby.xiaomi.DolbyController
|
||||
import co.aospa.dolby.xiaomi.R
|
||||
import com.android.settingslib.widget.MainSwitchPreference
|
||||
import com.android.settingslib.widget.SettingsBasePreferenceFragment
|
||||
|
||||
class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
Preference.OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
|
||||
class DolbySettingsFragment : PreferenceFragment(),
|
||||
OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
private val appContext: Context
|
||||
get() = requireContext().applicationContext
|
||||
|
||||
private val switchBar by lazy { findPreference<MainSwitchPreference>(PREF_ENABLE)!! }
|
||||
private val profilePref by lazy { findPreference<ListPreference>(PREF_PROFILE)!! }
|
||||
private val presetPref by lazy { findPreference<Preference>(PREF_PRESET)!! }
|
||||
private val ieqPref by lazy { findPreference<DolbyIeqPreference>(PREF_IEQ)!! }
|
||||
private val stereoPref by lazy { findPreference<ListPreference>(PREF_STEREO)!! }
|
||||
private val dialoguePref by lazy { findPreference<ListPreference>(PREF_DIALOGUE)!! }
|
||||
private val bassPref by lazy { findPreference<SwitchPreferenceCompat>(PREF_BASS)!! }
|
||||
private val hpVirtPref by lazy { findPreference<SwitchPreferenceCompat>(PREF_HP_VIRTUALIZER)!! }
|
||||
private val spkVirtPref by lazy { findPreference<SwitchPreferenceCompat>(PREF_SPK_VIRTUALIZER)!! }
|
||||
private val volumePref by lazy { findPreference<SwitchPreferenceCompat>(PREF_VOLUME)!! }
|
||||
private val resetPref by lazy { findPreference<Preference>(PREF_RESET)!! }
|
||||
|
||||
private val dolbyController by lazy(LazyThreadSafetyMode.NONE) {
|
||||
DolbyController.getInstance(appContext)
|
||||
private val switchBar by lazy {
|
||||
findPreference<MainSwitchPreference>(PREF_ENABLE)!!
|
||||
}
|
||||
private val audioManager by lazy(LazyThreadSafetyMode.NONE) {
|
||||
appContext.getSystemService(AudioManager::class.java)
|
||||
private val profilePref by lazy {
|
||||
findPreference<ListPreference>(PREF_PROFILE)!!
|
||||
}
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
private val presetPref by lazy {
|
||||
findPreference<Preference>(PREF_PRESET)!!
|
||||
}
|
||||
private val ieqPref by lazy {
|
||||
findPreference<DolbyIeqPreference>(PREF_IEQ)!!
|
||||
}
|
||||
private val stereoPref by lazy {
|
||||
findPreference<ListPreference>(PREF_STEREO)!!
|
||||
}
|
||||
private val dialoguePref by lazy {
|
||||
findPreference<ListPreference>(PREF_DIALOGUE)!!
|
||||
}
|
||||
private val bassPref by lazy {
|
||||
findPreference<SwitchPreferenceCompat>(PREF_BASS)!!
|
||||
}
|
||||
private val hpVirtPref by lazy {
|
||||
findPreference<SwitchPreferenceCompat>(PREF_HP_VIRTUALIZER)!!
|
||||
}
|
||||
private val spkVirtPref by lazy {
|
||||
findPreference<SwitchPreferenceCompat>(PREF_SPK_VIRTUALIZER)!!
|
||||
}
|
||||
private val volumePref by lazy {
|
||||
findPreference<SwitchPreferenceCompat>(PREF_VOLUME)!!
|
||||
}
|
||||
private val resetPref by lazy {
|
||||
findPreference<Preference>(PREF_RESET)!!
|
||||
}
|
||||
|
||||
private val dolbyController by lazy { DolbyController.getInstance(context) }
|
||||
private val audioManager by lazy { context.getSystemService(AudioManager::class.java) }
|
||||
private val handler = Handler()
|
||||
|
||||
private var isOnSpeaker = true
|
||||
set(value) {
|
||||
@@ -85,29 +99,26 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
dlog(TAG, "onCreatePreferences")
|
||||
setPreferencesFromResource(R.xml.dolby_settings, rootKey)
|
||||
}
|
||||
addPreferencesFromResource(R.xml.dolby_settings)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val profile = dolbyController.profile
|
||||
preferenceManager.preferenceDataStore = DolbyPreferenceStore(appContext).also {
|
||||
preferenceManager.preferenceDataStore = DolbyPreferenceStore(context).also {
|
||||
it.profile = profile
|
||||
}
|
||||
|
||||
val dsOn = dolbyController.dsOn
|
||||
switchBar.addOnSwitchChangeListener(this)
|
||||
switchBar.isChecked = dsOn
|
||||
switchBar.setChecked(dsOn)
|
||||
|
||||
profilePref.onPreferenceChangeListener = this
|
||||
updateProfileIcon(profile)
|
||||
profilePref.isEnabled = dsOn
|
||||
profilePref.setEnabled(dsOn)
|
||||
profilePref.apply {
|
||||
if (entryValues.contains(profile.toString())) {
|
||||
summary = "%s"
|
||||
value = profile.toString()
|
||||
} else {
|
||||
summary = getString(R.string.dolby_unknown)
|
||||
summary = context.getString(R.string.dolby_unknown)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,21 +134,21 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
dolbyController.resetProfileSpecificSettings()
|
||||
updateProfileSpecificPrefs()
|
||||
Toast.makeText(
|
||||
appContext,
|
||||
getString(R.string.dolby_reset_profile_toast, profilePref.summary),
|
||||
context,
|
||||
context.getString(R.string.dolby_reset_profile_toast, profilePref.summary),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
true
|
||||
}
|
||||
|
||||
audioManager?.registerAudioDeviceCallback(audioDeviceCallback, handler)
|
||||
audioManager!!.registerAudioDeviceCallback(audioDeviceCallback, handler)
|
||||
updateSpeakerState()
|
||||
updateProfileSpecificPrefs()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
dlog(TAG, "onDestroyView")
|
||||
audioManager?.unregisterAudioDeviceCallback(audioDeviceCallback)
|
||||
audioManager!!.unregisterAudioDeviceCallback(audioDeviceCallback)
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
@@ -156,13 +167,35 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
updateProfileIcon(profile)
|
||||
updateProfileSpecificPrefs()
|
||||
}
|
||||
PREF_SPK_VIRTUALIZER -> dolbyController.setSpeakerVirtEnabled(newValue as Boolean)
|
||||
PREF_HP_VIRTUALIZER -> dolbyController.setHeadphoneVirtEnabled(newValue as Boolean)
|
||||
PREF_STEREO -> dolbyController.setStereoWideningAmount(newValue.toString().toInt())
|
||||
PREF_DIALOGUE -> dolbyController.setDialogueEnhancerAmount(newValue.toString().toInt())
|
||||
PREF_BASS -> dolbyController.setBassEnhancerEnabled(newValue as Boolean)
|
||||
PREF_VOLUME -> dolbyController.setVolumeLevelerEnabled(newValue as Boolean)
|
||||
PREF_IEQ -> dolbyController.setIeqPreset(newValue.toString().toInt())
|
||||
|
||||
PREF_SPK_VIRTUALIZER -> {
|
||||
dolbyController.setSpeakerVirtEnabled(newValue as Boolean)
|
||||
}
|
||||
|
||||
PREF_HP_VIRTUALIZER -> {
|
||||
dolbyController.setHeadphoneVirtEnabled(newValue as Boolean)
|
||||
}
|
||||
|
||||
PREF_STEREO -> {
|
||||
dolbyController.setStereoWideningAmount(newValue.toString().toInt())
|
||||
}
|
||||
|
||||
PREF_DIALOGUE -> {
|
||||
dolbyController.setDialogueEnhancerAmount(newValue.toString().toInt())
|
||||
}
|
||||
|
||||
PREF_BASS -> {
|
||||
dolbyController.setBassEnhancerEnabled(newValue as Boolean)
|
||||
}
|
||||
|
||||
PREF_VOLUME -> {
|
||||
dolbyController.setVolumeLevelerEnabled(newValue as Boolean)
|
||||
}
|
||||
|
||||
PREF_IEQ -> {
|
||||
dolbyController.setIeqPreset(newValue.toString().toInt())
|
||||
}
|
||||
|
||||
else -> return false
|
||||
}
|
||||
return true
|
||||
@@ -171,21 +204,18 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
|
||||
dlog(TAG, "onCheckedChanged($isChecked)")
|
||||
dolbyController.dsOn = isChecked
|
||||
profilePref.isEnabled = isChecked
|
||||
profilePref.setEnabled(isChecked)
|
||||
updateProfileSpecificPrefs()
|
||||
}
|
||||
|
||||
private fun updateSpeakerState() {
|
||||
val devices = audioManager
|
||||
?.getDevicesForAttributes(ATTRIBUTES_MEDIA)
|
||||
.orEmpty()
|
||||
val firstType = devices.firstOrNull()?.type
|
||||
isOnSpeaker = (firstType == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
|
||||
val device = audioManager!!.getDevicesForAttributes(ATTRIBUTES_MEDIA)[0]
|
||||
isOnSpeaker = (device.type == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
|
||||
}
|
||||
|
||||
private fun updateProfileSpecificPrefs() {
|
||||
val unknownRes = getString(R.string.dolby_unknown)
|
||||
val headphoneRes = getString(R.string.dolby_connect_headphones)
|
||||
val unknownRes = context.getString(R.string.dolby_unknown)
|
||||
val headphoneRes = context.getString(R.string.dolby_connect_headphones)
|
||||
val dsOn = dolbyController.dsOn
|
||||
val currentProfile = dolbyController.profile
|
||||
|
||||
@@ -195,15 +225,15 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
)
|
||||
|
||||
val enable = dsOn && (currentProfile != -1)
|
||||
presetPref.isEnabled = enable
|
||||
spkVirtPref.isEnabled = enable
|
||||
ieqPref.isEnabled = enable
|
||||
dialoguePref.isEnabled = enable
|
||||
volumePref.isEnabled = enable
|
||||
bassPref.isEnabled = enable
|
||||
resetPref.isEnabled = enable
|
||||
hpVirtPref.isEnabled = enable && !isOnSpeaker
|
||||
stereoPref.isEnabled = enable && !isOnSpeaker
|
||||
presetPref.setEnabled(enable)
|
||||
spkVirtPref.setEnabled(enable)
|
||||
ieqPref.setEnabled(enable)
|
||||
dialoguePref.setEnabled(enable)
|
||||
volumePref.setEnabled(enable)
|
||||
bassPref.setEnabled(enable)
|
||||
resetPref.setEnabled(enable)
|
||||
hpVirtPref.setEnabled(enable && !isOnSpeaker)
|
||||
stereoPref.setEnabled(enable && !isOnSpeaker)
|
||||
|
||||
if (!enable) return
|
||||
|
||||
@@ -229,9 +259,9 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
}
|
||||
}
|
||||
|
||||
spkVirtPref.isChecked = dolbyController.getSpeakerVirtEnabled(currentProfile)
|
||||
volumePref.isChecked = dolbyController.getVolumeLevelerEnabled(currentProfile)
|
||||
bassPref.isChecked = dolbyController.getBassEnhancerEnabled(currentProfile)
|
||||
spkVirtPref.setChecked(dolbyController.getSpeakerVirtEnabled(currentProfile))
|
||||
volumePref.setChecked(dolbyController.getVolumeLevelerEnabled(currentProfile))
|
||||
bassPref.setChecked(dolbyController.getBassEnhancerEnabled(currentProfile))
|
||||
|
||||
// below prefs are not enabled on loudspeaker
|
||||
if (isOnSpeaker) {
|
||||
@@ -251,7 +281,7 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
}
|
||||
|
||||
hpVirtPref.apply {
|
||||
isChecked = dolbyController.getHeadphoneVirtEnabled(currentProfile)
|
||||
setChecked(dolbyController.getHeadphoneVirtEnabled(currentProfile))
|
||||
summary = null
|
||||
}
|
||||
}
|
||||
@@ -269,7 +299,7 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
companion object {
|
||||
private const val TAG = "DolbySettingsFragment"
|
||||
private val ATTRIBUTES_MEDIA = AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.build()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022,2025 The LineageOS Project
|
||||
* Copyright (C) 2022 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -13,14 +13,12 @@ class UdfpsHandler {
|
||||
public:
|
||||
virtual ~UdfpsHandler() = default;
|
||||
|
||||
virtual void init(fingerprint_device_t* device) {};
|
||||
virtual void onFingerDown(uint32_t x, uint32_t y, float minor, float major) {};
|
||||
virtual void onFingerUp() {};
|
||||
virtual void init(fingerprint_device_t* device) = 0;
|
||||
virtual void onFingerDown(uint32_t x, uint32_t y, float minor, float major) = 0;
|
||||
virtual void onFingerUp() = 0;
|
||||
|
||||
virtual void onAcquired(int32_t result, int32_t vendorCode) {};
|
||||
virtual void onAuthenticationSucceeded() {};
|
||||
virtual void onAuthenticationFailed() {};
|
||||
virtual void cancel() {};
|
||||
virtual void onAcquired(int32_t result, int32_t vendorCode) = 0;
|
||||
virtual void cancel() = 0;
|
||||
};
|
||||
|
||||
struct UdfpsHandlerFactory {
|
||||
|
||||
45
hidl/touch/Android.bp
Normal file
45
hidl/touch/Android.bp
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Copyright (C) 2022 The LineageOS Project
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
soong_config_module_type {
|
||||
name: "xiaomi_touch_hal_cc_defaults",
|
||||
module_type: "cc_defaults",
|
||||
config_namespace: "XIAOMI_TOUCH",
|
||||
value_variables: ["HIGH_TOUCH_POLLING_PATH"],
|
||||
properties: ["cppflags"],
|
||||
}
|
||||
|
||||
xiaomi_touch_hal_cc_defaults {
|
||||
name: "xiaomi_touch_hal_defaults",
|
||||
soong_config_variables: {
|
||||
HIGH_TOUCH_POLLING_PATH: {
|
||||
cppflags: ["-DHIGH_TOUCH_POLLING_PATH=\"%s\""],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "vendor.lineage.touch@1.0-service.xiaomi",
|
||||
defaults: [
|
||||
"hidl_defaults",
|
||||
"xiaomi_touch_hal_defaults",
|
||||
],
|
||||
vintf_fragments: ["vendor.lineage.touch@1.0-service.xiaomi.xml"],
|
||||
init_rc: ["vendor.lineage.touch@1.0-service.xiaomi.rc"],
|
||||
relative_install_path: "hw",
|
||||
proprietary: true,
|
||||
srcs: [
|
||||
"HighTouchPollingRate.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libbinder",
|
||||
"libhidlbase",
|
||||
"libutils",
|
||||
"vendor.lineage.touch@1.0",
|
||||
],
|
||||
}
|
||||
37
hidl/touch/HighTouchPollingRate.cpp
Normal file
37
hidl/touch/HighTouchPollingRate.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "HighTouchPollingRateService"
|
||||
|
||||
#include "HighTouchPollingRate.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
Return<bool> HighTouchPollingRate::isEnabled() {
|
||||
std::ifstream file(HIGH_TOUCH_POLLING_PATH);
|
||||
int enabled;
|
||||
file >> enabled;
|
||||
|
||||
return enabled == 1;
|
||||
}
|
||||
|
||||
Return<bool> HighTouchPollingRate::setEnabled(bool enabled) {
|
||||
std::ofstream file(HIGH_TOUCH_POLLING_PATH);
|
||||
file << (enabled ? "1" : "0");
|
||||
return !file.fail();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
30
hidl/touch/HighTouchPollingRate.h
Normal file
30
hidl/touch/HighTouchPollingRate.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vendor/lineage/touch/1.0/IHighTouchPollingRate.h>
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace touch {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::Return;
|
||||
|
||||
class HighTouchPollingRate : public IHighTouchPollingRate {
|
||||
public:
|
||||
// Methods from ::vendor::lineage::touch::V1_0::IHighTouchPollingRate follow.
|
||||
Return<bool> isEnabled() override;
|
||||
Return<bool> setEnabled(bool enabled) override;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace touch
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
33
hidl/touch/service.cpp
Normal file
33
hidl/touch/service.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_TAG "lineage.touch@1.0-service.xiaomi"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
|
||||
#include "HighTouchPollingRate.h"
|
||||
|
||||
using ::vendor::lineage::touch::V1_0::IHighTouchPollingRate;
|
||||
using ::vendor::lineage::touch::V1_0::implementation::HighTouchPollingRate;
|
||||
|
||||
int main() {
|
||||
android::sp<IHighTouchPollingRate> highTouchPollingRate = new HighTouchPollingRate();
|
||||
|
||||
android::hardware::configureRpcThreadpool(1, true);
|
||||
|
||||
if (highTouchPollingRate->registerAsService() != android::OK) {
|
||||
LOG(ERROR) << "Cannot register touchscreen high polling rate HAL service.";
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG(INFO) << "Touchscreen HAL service ready.";
|
||||
|
||||
android::hardware::joinRpcThreadpool();
|
||||
|
||||
LOG(ERROR) << "Touchscreen HAL service failed to join thread pool.";
|
||||
return 1;
|
||||
}
|
||||
5
hidl/touch/vendor.lineage.touch@1.0-service.xiaomi.rc
Normal file
5
hidl/touch/vendor.lineage.touch@1.0-service.xiaomi.rc
Normal file
@@ -0,0 +1,5 @@
|
||||
service vendor.touch-hal-1-0 /vendor/bin/hw/vendor.lineage.touch@1.0-service.xiaomi
|
||||
interface vendor.lineage.touch@1.0::IHighTouchPollingRate default
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
@@ -1,7 +1,8 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<hal format="hidl">
|
||||
<name>vendor.lineage.touch</name>
|
||||
<version>1</version>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IHighTouchPollingRate</name>
|
||||
<instance>default</instance>
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2020-2025 The LineageOS Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
hidl_package_root {
|
||||
name: "com.fingerprints",
|
||||
path: "hardware/xiaomi/interfaces/fingerprints",
|
||||
@@ -17,129 +12,3 @@ hidl_package_root {
|
||||
name: "vendor.xiaomi",
|
||||
path: "hardware/xiaomi/interfaces/xiaomi",
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_com_fingerprints_extension_interface",
|
||||
interfaces: [
|
||||
"com.fingerprints.extension@3.0::IFingerprintAuthenticator",
|
||||
"com.fingerprints.extension@3.0::IFingerprintCalibration",
|
||||
"com.fingerprints.extension@3.0::IFingerprintEngineering",
|
||||
"com.fingerprints.extension@3.0::IFingerprintNavigation",
|
||||
"com.fingerprints.extension@3.0::IFingerprintOptical",
|
||||
"com.fingerprints.extension@3.0::IFingerprintRecalibration",
|
||||
"com.fingerprints.extension@3.0::IFingerprintSenseTouch",
|
||||
"com.fingerprints.extension@3.0::IFingerprintSensorTest",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_focaltech_fingerprint_interface",
|
||||
interfaces: [
|
||||
"vendor.focaltech.fingerprint@1.0::IFocalFingerprintService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_goodix_hardware_cap_biometrics_fingerprint_interface",
|
||||
interfaces: [
|
||||
"vendor.goodix.hardware.cap.biometrics.fingerprint@2.1::IGoodixFingerprintDaemon",
|
||||
"vendor.goodix.hardware.cap.biometrics.fingerprint@2.1::IGoodixFingerprintDaemonExt",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_pixelworks_hardware_display_interface",
|
||||
interfaces: [
|
||||
"vendor.pixelworks.hardware.display@1.0::IIris",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_silead_hardware_fingerprintext_interface",
|
||||
interfaces: [
|
||||
"vendor.silead.hardware.fingerprintext@1.0::ISileadFingerprint",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_synaptics_fingerprints_interfaces_extensions_interface",
|
||||
interfaces: [
|
||||
"vendor.synaptics.fingerprints.interfaces.extensions@1.0::IFpCollection",
|
||||
"vendor.synaptics.fingerprints.interfaces.extensions@1.0::INavigation",
|
||||
"vendor.synaptics.fingerprints.interfaces.extensions@1.0::ISensorTest",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_bgservice_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.bgservice@1.0::IBGService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_cameraperf_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.cameraperf@1.0::IMiCameraPerfService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_campostproc_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.campostproc@1.0::IMiPostProcService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_citsensorservice_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.citsensorservice@1.0::ICitSensorService",
|
||||
"vendor.xiaomi.hardware.citsensorservice@1.1::ICitSensorService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_dtool_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.dtool@1.0::IDtool",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_micharge_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.micharge@1.0::IMiCharge",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_quickcamera_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.quickcamera@1.0::IQuickCameraService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_hardware_tidaservice_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.hardware.tidaservice@1.0::ITidaService",
|
||||
"vendor.xiaomi.hardware.tidaservice@1.1::ITidaService",
|
||||
"vendor.xiaomi.hardware.tidaservice@1.2::ITidaService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_sensor_citsensorservice_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.sensor.citsensorservice@1.1::ICitSensorService",
|
||||
"vendor.xiaomi.sensor.citsensorservice@2.0::ICitSensorService",
|
||||
],
|
||||
}
|
||||
|
||||
prebuilt_hidl_interfaces {
|
||||
name: "hidl_vendor_xiaomi_sensor_communicate_interface",
|
||||
interfaces: [
|
||||
"vendor.xiaomi.sensor.communicate@1.0::ISensorCommunicate",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ package vendor.xiaomi.hardware.displayfeature@1.0;
|
||||
import @1.0::IDisplayFeatureCallback;
|
||||
|
||||
interface IDisplayFeature {
|
||||
setFeature(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status);
|
||||
registerCallback(uint32_t displayId, IDisplayFeatureCallback callback) generates (Status status);
|
||||
setFunction(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status);
|
||||
sendMessage(uint32_t index, uint32_t value, string cmd);
|
||||
notifyBrightness(uint32_t brightness);
|
||||
registerCallback(uint32_t displayId, IDisplayFeatureCallback callback) generates (Status status);
|
||||
sendMessage(uint32_t index, uint32_t value, string cmd);
|
||||
sendPanelCommand(string cmd) generates (Status status);
|
||||
sendRefreshCommand() generates (Status status);
|
||||
sendPostProcCommand(uint32_t cmd, uint32_t value) generates (Status status);
|
||||
sendRefreshCommand() generates (Status status);
|
||||
setFeature(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status);
|
||||
setFunction(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status);
|
||||
};
|
||||
|
||||
@@ -2,19 +2,42 @@
|
||||
* Copyright (C) 2022 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
*/
|
||||
|
||||
static int stub_fail() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
static char* stub_fail_str() {
|
||||
static char *stub_fail_str() {
|
||||
return "stub";
|
||||
}
|
||||
|
||||
void* mg_facepp[] = {
|
||||
&stub_fail, &stub_fail, &stub_fail, &stub_fail_str, &stub_fail_str, &stub_fail, &stub_fail,
|
||||
&stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail,
|
||||
&stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail,
|
||||
&stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail, &stub_fail,
|
||||
void *mg_facepp[] = {
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail_str,
|
||||
&stub_fail_str,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
&stub_fail,
|
||||
};
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
//
|
||||
// SPDX-FileCopyrightText: The LineageOS Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
phony {
|
||||
name: "XiaomiEuicc",
|
||||
required: [
|
||||
"EuiccPolicy",
|
||||
"EuiccPolicyXiaomi",
|
||||
],
|
||||
}
|
||||
|
||||
runtime_resource_overlay {
|
||||
name: "EuiccPolicyXiaomi",
|
||||
product_specific: true,
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.lineageos.euicc.overlay.xiaomi">
|
||||
<overlay android:targetPackage="org.lineageos.euicc"
|
||||
android:isStatic="true" />
|
||||
</manifest>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources>
|
||||
<string name="sim_slot_mappings_json" translatable="false">
|
||||
{
|
||||
\"sim-slot-mappings\": [
|
||||
{
|
||||
\"devices\": [
|
||||
\"XIG05\",
|
||||
\"fuxi\",
|
||||
\"garnet\",
|
||||
\"nuwa\"
|
||||
],
|
||||
\"esim-slot-ids\": [
|
||||
1
|
||||
],
|
||||
\"psim-slot-ids\": [
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</string>
|
||||
<string name="sim_illustration_lottie_mappings_json" translatable="false">
|
||||
{
|
||||
\"sim_illustration_lottie_mappings\": [
|
||||
{
|
||||
\"devices\": [
|
||||
\"XIG05\",
|
||||
\"fuxi\",
|
||||
\"garnet\",
|
||||
\"nuwa\"
|
||||
],
|
||||
\"illustration_lottie\": \"sim_illustration_lottie_bottom\"
|
||||
}
|
||||
]
|
||||
}
|
||||
</string>
|
||||
</resources>
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.ifaa.aidl.manager
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IHwBinder
|
||||
import android.os.SystemProperties
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import org.json.JSONObject
|
||||
import vendor.xiaomi.hardware.mlipay.V1_1.IMlipayService
|
||||
|
||||
class IfaaService : Service() {
|
||||
private var _mlipayService: IMlipayService? = null
|
||||
|
||||
private val mlipayServiceDeathRecipient =
|
||||
IHwBinder.DeathRecipient {
|
||||
Log.i(LOG_TAG, "mlipay service died")
|
||||
_mlipayService = null
|
||||
}
|
||||
|
||||
private val mBinder =
|
||||
object : IfaaManagerService.Stub() {
|
||||
override fun getSupportBIOTypes(): Int {
|
||||
val fpVendor = SystemProperties.get(FP_VENDOR_PROP, "")
|
||||
val isUdfps = SystemProperties.getBoolean(IS_UDFPS_PROP, false)
|
||||
|
||||
val supportedBioMask =
|
||||
when (!invalidFpVendors.contains(fpVendor.lowercase())) {
|
||||
true -> AUTH_TYPE_FINGERPRINT or AUTH_TYPE_IRIS
|
||||
else -> AUTH_TYPE_IRIS
|
||||
}
|
||||
|
||||
val ifaaProp =
|
||||
SystemProperties.getInt(SUPPORTED_BIO_MASK_PROP, 0) and
|
||||
supportedBioMask or
|
||||
when (isUdfps) {
|
||||
true -> AUTH_TYPE_OPTICAL_FINGERPRINT
|
||||
else -> 0
|
||||
}
|
||||
|
||||
return ifaaProp
|
||||
}
|
||||
|
||||
override fun startBIOManager(authType: Int) =
|
||||
when (authType) {
|
||||
AUTH_TYPE_FINGERPRINT -> {
|
||||
applicationContext.startActivity(
|
||||
Intent(Settings.ACTION_SECURITY_SETTINGS).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
)
|
||||
|
||||
COMMAND_OK
|
||||
}
|
||||
|
||||
else -> COMMAND_FAIL
|
||||
}
|
||||
|
||||
override fun getDeviceModel() = "${Build.MANUFACTURER}-${Build.DEVICE}"
|
||||
|
||||
override fun processCmd(param: ByteArray) =
|
||||
getMlipayService()?.let { mlipayService ->
|
||||
var receiveBuffer: ByteArray? = null
|
||||
|
||||
val paramByteArray =
|
||||
ArrayList<Byte>().apply {
|
||||
for (byte in param) {
|
||||
add(byte)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
val receiveBufferByteArray =
|
||||
mlipayService.invoke_command(paramByteArray, paramByteArray.size)
|
||||
|
||||
receiveBuffer = receiveBufferByteArray.toByteArray()
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "processCmdImpl: mlipay invoke_command failed", e)
|
||||
}
|
||||
|
||||
receiveBuffer
|
||||
}
|
||||
|
||||
override fun getVersion() = 4
|
||||
|
||||
override fun getExtInfo(authType: Int, keyExtInfo: String) = initExtString()
|
||||
|
||||
override fun setExtInfo(authType: Int, keyExtInfo: String, valExtInfo: String) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
override fun getEnabled(bioType: Int) =
|
||||
when (bioType) {
|
||||
AUTH_TYPE_FINGERPRINT -> BIOMETRICS_AVAILABLE
|
||||
else -> SCREEN_LOCK_NONE
|
||||
}
|
||||
|
||||
override fun getIDList(bioType: Int): IntArray {
|
||||
var idList = IntArray(0)
|
||||
|
||||
getMlipayService()?.let { mlipayService ->
|
||||
try {
|
||||
val idListAL = mlipayService.ifaa_get_idlist(bioType)
|
||||
|
||||
idList = idListAL.toIntArray()
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "getIDListImpl: mlipay ifaa_get_idlist failed", e)
|
||||
}
|
||||
}
|
||||
|
||||
return idList
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent) = mBinder
|
||||
|
||||
private fun getMlipayService() =
|
||||
_mlipayService
|
||||
?: runCatching { IMlipayService.getService(true) }
|
||||
.onSuccess {
|
||||
_mlipayService = it
|
||||
it.linkToDeath(mlipayServiceDeathRecipient, 0)
|
||||
}
|
||||
.getOrNull()
|
||||
|
||||
private fun initExtString(): String {
|
||||
val obj = JSONObject()
|
||||
val keyInfo = JSONObject()
|
||||
|
||||
val xy = SystemProperties.get(UDFPS_LOCATION_X_Y_PROP, "")
|
||||
val wh = SystemProperties.get(UDFPS_SIZE_W_H_PROP, "")
|
||||
|
||||
try {
|
||||
if (!validateVal(xy) || !validateVal(wh)) {
|
||||
Log.e(LOG_TAG, "initExtString: invalidate, xy: $xy, wh: $wh")
|
||||
return ""
|
||||
}
|
||||
|
||||
val split = xy.split(",")
|
||||
val split2 = wh.split(",")
|
||||
|
||||
keyInfo.put("startX", split[0].toInt())
|
||||
keyInfo.put("startY", split[1].toInt())
|
||||
keyInfo.put("width", split2[0].toInt())
|
||||
keyInfo.put("height", split2[1].toInt())
|
||||
keyInfo.put("navConflict", true)
|
||||
|
||||
obj.put("type", 0)
|
||||
obj.put("fullView", keyInfo)
|
||||
|
||||
return obj.toString()
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "initExtString: Exception, xy: $xy, wh: $wh", e)
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
private fun validateVal(str: String) = !"".equals(str, ignoreCase = true) && str.contains(",")
|
||||
|
||||
companion object {
|
||||
private val LOG_TAG = IfaaService::class.simpleName!!
|
||||
|
||||
private const val AUTH_TYPE_NOT_SUPPORT = 0
|
||||
private const val AUTH_TYPE_FINGERPRINT = 1
|
||||
private const val AUTH_TYPE_IRIS = 1.shl(1)
|
||||
private const val AUTH_TYPE_OPTICAL_FINGERPRINT = 1.shl(2)
|
||||
|
||||
private const val BIOMETRICS_AVAILABLE = 1000
|
||||
private const val SCREEN_LOCK_NONE = 1003
|
||||
|
||||
private const val COMMAND_OK = 0
|
||||
private const val COMMAND_FAIL = -1
|
||||
|
||||
private const val SUPPORTED_BIO_MASK_PROP = "persist.vendor.sys.pay.ifaa"
|
||||
private const val FP_VENDOR_PROP = "persist.vendor.sys.fp.vendor"
|
||||
private const val IS_UDFPS_PROP = "ro.hardware.fp.udfps"
|
||||
private const val UDFPS_LOCATION_X_Y_PROP = "persist.vendor.sys.fp.udfps.location.X_Y"
|
||||
private const val UDFPS_SIZE_W_H_PROP = "persist.vendor.sys.fp.udfps.size.width_height"
|
||||
|
||||
private val invalidFpVendors = arrayOf("", "none")
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <string.h>
|
||||
#include <utils/SystemClock.h>
|
||||
|
||||
static const char* udfps_state_paths[] = {
|
||||
static const char *udfps_state_paths[] = {
|
||||
"/sys/devices/virtual/touch/tp_dev/fp_state",
|
||||
"/sys/touchpanel/fp_state",
|
||||
NULL,
|
||||
|
||||
@@ -221,7 +221,7 @@ SysfsPollingOneShotSensor::SysfsPollingOneShotSensor(
|
||||
int32_t sensorHandle, ISensorsEventCallback* callback, const std::string& pollPath,
|
||||
const std::string& enablePath, const std::string& name, const std::string& typeAsString,
|
||||
SensorType type)
|
||||
: OneShotSensor(sensorHandle, callback), mEnablePath(enablePath) {
|
||||
: OneShotSensor(sensorHandle, callback) {
|
||||
mSensorInfo.name = name;
|
||||
mSensorInfo.type = type;
|
||||
mSensorInfo.typeAsString = typeAsString;
|
||||
@@ -230,6 +230,8 @@ SysfsPollingOneShotSensor::SysfsPollingOneShotSensor(
|
||||
mSensorInfo.power = 0;
|
||||
mSensorInfo.flags |= SensorFlagBits::WAKE_UP;
|
||||
|
||||
mEnableStream.open(enablePath);
|
||||
|
||||
int rc;
|
||||
|
||||
rc = pipe(mWaitPipeFd);
|
||||
@@ -265,12 +267,8 @@ SysfsPollingOneShotSensor::~SysfsPollingOneShotSensor() {
|
||||
}
|
||||
|
||||
void SysfsPollingOneShotSensor::writeEnable(bool enable) {
|
||||
std::call_once(mEnableOpenOnce, [&] { mEnableStream.open(mEnablePath); });
|
||||
|
||||
if (mEnableStream) {
|
||||
mEnableStream << (enable ? '1' : '0') << std::flush;
|
||||
} else {
|
||||
ALOGE("Failed to write enable to %s", mEnablePath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace implementation {
|
||||
|
||||
class ISensorsEventCallback {
|
||||
public:
|
||||
virtual ~ISensorsEventCallback() {};
|
||||
virtual ~ISensorsEventCallback(){};
|
||||
virtual void postEvents(const std::vector<Event>& events, bool wakeup) = 0;
|
||||
};
|
||||
|
||||
@@ -119,8 +119,6 @@ class SysfsPollingOneShotSensor : public OneShotSensor {
|
||||
struct pollfd mPolls[2];
|
||||
int mWaitPipeFd[2];
|
||||
int mPollFd;
|
||||
std::string mEnablePath;
|
||||
std::once_flag mEnableOpenOnce;
|
||||
};
|
||||
|
||||
class DoubleTapSensor : public SysfsPollingOneShotSensor {
|
||||
|
||||
@@ -14,5 +14,8 @@ cc_library_shared {
|
||||
"libcutils",
|
||||
"libutils",
|
||||
],
|
||||
static_libs: [
|
||||
"libc++fs",
|
||||
],
|
||||
export_include_dirs: ["."],
|
||||
}
|
||||
|
||||
@@ -57,6 +57,22 @@
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby.hardware.dms</name>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby_v3_6.hardware.dms360</name>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.goodix.hardware.biometrics.fingerprint</name>
|
||||
<version>2.1</version>
|
||||
@@ -97,30 +113,6 @@
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby.hardware.dms</name>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby_sp.hardware.dmssp</name>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby_v3_6.hardware.dms360</name>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.goodix.hardware.fingerprintextension</name>
|
||||
<version>1.0</version>
|
||||
@@ -169,14 +161,6 @@
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.cameraperf</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMiCameraPerfService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.campostproc</name>
|
||||
<version>1.0</version>
|
||||
@@ -185,14 +169,6 @@
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.citsensorservice</name>
|
||||
<version>1.0-1</version>
|
||||
<interface>
|
||||
<name>ICitSensorService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.displayfeature</name>
|
||||
<version>1.0</version>
|
||||
@@ -201,14 +177,6 @@
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.dtool</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDtool</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.fingerprintextension</name>
|
||||
<version>1.0</version>
|
||||
@@ -294,6 +262,7 @@
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hw.touchfeature</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ITouchFeature</name>
|
||||
|
||||
Reference in New Issue
Block a user