├── .clang-format
├── Android.bp
├── KeyHandler
├── Android.bp
├── AndroidManifest.xml
├── proguard.flags
├── res
│ ├── values-ar
│ │ └── strings.xml
│ ├── values-ast-rES
│ │ └── strings.xml
│ ├── values-az
│ │ └── strings.xml
│ ├── values-bg
│ │ └── strings.xml
│ ├── values-ca
│ │ └── strings.xml
│ ├── values-cs
│ │ └── strings.xml
│ ├── values-cy
│ │ └── strings.xml
│ ├── values-da
│ │ └── strings.xml
│ ├── values-de
│ │ └── strings.xml
│ ├── values-el
│ │ └── strings.xml
│ ├── values-en-rAU
│ │ └── strings.xml
│ ├── values-en-rCA
│ │ └── strings.xml
│ ├── values-en-rGB
│ │ └── strings.xml
│ ├── values-en-rIN
│ │ └── strings.xml
│ ├── values-es
│ │ └── strings.xml
│ ├── values-fa
│ │ └── strings.xml
│ ├── values-fi
│ │ └── strings.xml
│ ├── values-fr
│ │ └── strings.xml
│ ├── values-fur-rIT
│ │ └── strings.xml
│ ├── values-ga-rIE
│ │ └── strings.xml
│ ├── values-hu
│ │ └── strings.xml
│ ├── values-in
│ │ └── strings.xml
│ ├── values-is
│ │ └── strings.xml
│ ├── values-it
│ │ └── strings.xml
│ ├── values-iw
│ │ └── strings.xml
│ ├── values-ja
│ │ └── strings.xml
│ ├── values-ka
│ │ └── strings.xml
│ ├── values-ko
│ │ └── strings.xml
│ ├── values-nl
│ │ └── strings.xml
│ ├── values-pl
│ │ └── strings.xml
│ ├── values-pt-rBR
│ │ └── strings.xml
│ ├── values-pt-rPT
│ │ └── strings.xml
│ ├── values-ro
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values-sl
│ │ └── strings.xml
│ ├── values-sq
│ │ └── strings.xml
│ ├── values-sv
│ │ └── strings.xml
│ ├── values-ta
│ │ └── strings.xml
│ ├── values-tr
│ │ └── strings.xml
│ ├── values-ug
│ │ └── strings.xml
│ ├── values-vi
│ │ └── strings.xml
│ ├── values-zh-rCN
│ │ └── strings.xml
│ ├── values-zh-rTW
│ │ └── strings.xml
│ ├── values
│ │ ├── arrays.xml
│ │ └── strings.xml
│ └── xml
│ │ └── button_panel.xml
├── src
│ └── org
│ │ └── lineageos
│ │ └── settings
│ │ └── device
│ │ ├── BootCompletedReceiver.kt
│ │ ├── ButtonSettingsActivity.kt
│ │ ├── ButtonSettingsFragment.kt
│ │ ├── ConfigPanelSearchIndexablesProvider.kt
│ │ └── KeyHandler.kt
├── tri-state-key-calibrate.rc
└── tri-state-key-calibrate.sh
├── aidl
├── livedisplay
│ ├── Android.bp
│ ├── AntiFlicker.cpp
│ ├── SunlightEnhancement.cpp
│ ├── include
│ │ └── livedisplay
│ │ │ └── oneplus
│ │ │ ├── AntiFlicker.h
│ │ │ └── SunlightEnhancement.h
│ ├── service.cpp
│ ├── vendor.lineage.livedisplay-service.oneplus-af.xml
│ ├── vendor.lineage.livedisplay-service.oneplus-pa.xml
│ ├── vendor.lineage.livedisplay-service.oneplus-se.xml
│ └── vendor.lineage.livedisplay-service.oneplus.rc
├── touch
│ ├── Android.bp
│ ├── TouchscreenGesture.cpp
│ ├── TouchscreenGesture.h
│ ├── TouchscreenGestureConfig.h
│ ├── service.cpp
│ ├── vendor.lineage.touch-service.oneplus.rc
│ └── vendor.lineage.touch-service.oneplus.xml
└── vibrator
│ ├── Android.bp
│ ├── Vibrator.cpp
│ ├── include
│ └── Vibrator.h
│ ├── service.cpp
│ ├── vendor.qti.hardware.vibrator.service.oneplus.rc
│ └── vendor.qti.hardware.vibrator.service.oneplus.xml
├── audio_amplifier
├── Android.bp
└── audio_amplifier.c
├── dirac_gef
├── Android.bp
├── AndroidManifest.xml
├── assets
│ └── dirac_gef_init.txt
├── proguard.flags
└── src
│ └── org
│ └── lineageos
│ └── dirac
│ └── gef
│ └── BootCompletedReceiver.kt
├── doze
├── Android.bp
├── AndroidManifest.xml
├── proguard.flags
├── res
│ ├── drawable
│ │ ├── ic_pickup.xml
│ │ └── ic_pocket.xml
│ ├── values
│ │ ├── arrays.xml
│ │ └── config.xml
│ └── xml
│ │ └── doze_settings.xml
└── src
│ └── org
│ └── lineageos
│ └── settings
│ └── doze
│ ├── BootCompletedReceiver.kt
│ ├── DozeService.kt
│ ├── DozeSettingsActivity.kt
│ ├── DozeSettingsFragment.kt
│ ├── PickupSensor.kt
│ ├── PocketSensor.kt
│ └── Utils.kt
├── hidl
└── fingerprint
│ ├── Android.bp
│ ├── BiometricsFingerprint.cpp
│ ├── BiometricsFingerprint.h
│ ├── UdfpsExtension.cpp
│ ├── android.hardware.biometrics.fingerprint@2.3-service.oneplus.rc
│ ├── android.hardware.biometrics.fingerprint@2.3-service.oneplus.xml
│ ├── properties.cpp
│ └── service.cpp
├── interfaces
├── Android.bp
├── goodix
│ └── hardware
│ │ └── biometrics
│ │ └── fingerprint
│ │ └── 2.1
│ │ ├── Android.bp
│ │ ├── IGoodixFingerprintDaemon.hal
│ │ └── IGoodixFingerprintDaemonCallback.hal
├── oneplus
│ ├── camera
│ │ └── CameraHIDL
│ │ │ └── 1.0
│ │ │ ├── Android.bp
│ │ │ └── IOnePlusCameraProvider.hal
│ ├── fingerprint
│ │ └── extension
│ │ │ └── 1.0
│ │ │ ├── Android.bp
│ │ │ ├── IVendorFingerprintExtensions.hal
│ │ │ ├── IVendorFingerprintExtensionsCallback.hal
│ │ │ └── types.hal
│ └── hardware
│ │ └── drmkey
│ │ └── 1.0
│ │ ├── Android.bp
│ │ └── IOneplusDrmKey.hal
└── update-makefiles.sh
├── oneplus-fwk
├── Android.bp
└── src
│ └── android
│ ├── os
│ └── OPDiagnoseManager.java
│ └── util
│ └── OpFeatures.java
└── wifi-mac-generator
├── Android.bp
├── wifi-mac-generator.rc
└── wifi-mac-generator.sh
/.clang-format:
--------------------------------------------------------------------------------
1 | ../../build/soong/scripts/system-clang-format
--------------------------------------------------------------------------------
/Android.bp:
--------------------------------------------------------------------------------
1 | soong_namespace {
2 | imports: [
3 | "hardware/google/interfaces",
4 | "hardware/google/pixel",
5 | ],
6 | }
7 |
--------------------------------------------------------------------------------
/KeyHandler/Android.bp:
--------------------------------------------------------------------------------
1 | android_app {
2 | name: "KeyHandler",
3 |
4 | srcs: ["src/**/*.kt"],
5 | resource_dirs: ["res"],
6 |
7 | certificate: "platform",
8 | platform_apis: true,
9 | system_ext_specific: true,
10 |
11 | static_libs: [
12 | "org.lineageos.settings.resources",
13 | ],
14 |
15 | optimize: {
16 | proguard_flags_files: ["proguard.flags"],
17 | },
18 | }
19 |
20 | sh_binary {
21 | name: "tri-state-key-calibrate",
22 | init_rc: ["tri-state-key-calibrate.rc"],
23 | src: "tri-state-key-calibrate.sh",
24 | vendor: true,
25 | }
26 |
--------------------------------------------------------------------------------
/KeyHandler/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
20 |
21 |
22 |
23 |
29 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/KeyHandler/proguard.flags:
--------------------------------------------------------------------------------
1 | -keep class org.lineageos.settings.device.* {
2 | *;
3 | }
4 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ar/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | شريط تمرير التنبيه
8 | إجراء
9 | الموضع العلوي
10 | الموضع الأوسط
11 | الموضع السفلي
12 | لا شيء
13 | صامت
14 | عادي
15 | اهتزاز
16 | الأولوية فقط
17 | كتم الصوت تمامًا
18 | التنبيهات فقط
19 | كتم صوت الوسائط
20 | كتم صوت الوسائط عند التبديل إلى صامت
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ast-rES/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Eslizador pa les alertes
8 | Aición
9 | Posición cimera
10 | Posición central
11 | Posición baxera
12 | Nada
13 | Silenciu
14 | Normal
15 | Vibración
16 | Namás con prioridá
17 | Silenciu total
18 | Namás les alarmes
19 | Desactivar el soníu multimedia
20 | Desactiva\'l soníu de los elementos multimedia al cambiar a «Silenciu»
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-az/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Xəbərdarlıq diyircəyi
8 | Hərəkət
9 | Üst mövqe
10 | Orta mövqe
11 | Alt mövqe
12 | Heç biri
13 | Səssiz
14 | Normal
15 | Titrəmə
16 | Yalnız prioritet
17 | Tam səssizlik
18 | Yalnız zəngli saatlar
19 | Media səsi yoxdur
20 | Səssizə keçərkən medianı səssizə al
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-bg/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Плъзгач за предупреждение
8 | Действие
9 | Горна позиция
10 | Средна позиция
11 | Долна позиция
12 | Нищо
13 | Тих
14 | Нормален
15 | Вибрация
16 | Само важни
17 | Тотална тишина
18 | Само аларми
19 | Заглуши медията
20 | Заглуши само когато се превключва в тих режим
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ca/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Control lliscant d\'alerta
8 | Acció
9 | Posició superior
10 | Posició central
11 | Posició inferior
12 | Cap
13 | Silenci
14 | Normal
15 | Vibració
16 | Només prioritat
17 | Silenci total
18 | Només alarmes
19 | Silencia la multimèdia
20 | Silencia el contingut multimèdia quan canvieu a silenci
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-cs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Posuvník oznámení
8 | Akce
9 | Pozice nahoře
10 | Pozice uprostřed
11 | Pozice dole
12 | Žádný
13 | Tichý
14 | Normální
15 | Vibrace
16 | Pouze prioritní
17 | Úplné ticho
18 | Pouze budíky
19 | Ztlumit média
20 | Ztlumit média při přechodu na tichý režim
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-cy/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Llithridd rhybuddion
8 | Gweithred
9 | Lleoliad brig
10 | Lleoliad canol
11 | Lleoliad gwaelod
12 | Dim
13 | Distaw
14 | Arferol
15 | Dirgryniad
16 | Blaenoriaeth yn unig
17 | Distawrwydd llwyr
18 | Larymau yn unig
19 | Tewi cyfryngau
20 | Tewi cyfryngau wrth newid i ddistaw
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-da/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Ingen
8 |
9 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Alarmschieberegler
8 | Aktion
9 | Obere Position
10 | Mittlere Position
11 | Untere Position
12 | Keine
13 | Lautlos
14 | Normal
15 | Vibration
16 | Nur Priorität
17 | Völlige Stille
18 | Nur Alarme
19 | Medien stumm
20 | Medien beim Umschalten auf lautlos stummschalten
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-el/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Διακόπτης ειδοποιήσεων
8 | Ενέργεια
9 | Πάνω θέση
10 | Μεσαία θέση
11 | Κάτω θέση
12 | Τίποτα
13 | Αθόρυβο
14 | Κανονικό
15 | Δόνηση
16 | Μόνο προτεραιότητας
17 | Πλήρης σίγαση
18 | Μόνο ξυπνητήρια
19 | Σίγαση πολυμέσων
20 | Σίγαση πολυμέσων κατά την εναλλαγή σε αθόρυβο
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-en-rAU/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Alert slider
8 | Action
9 | Top position
10 | Middle position
11 | Bottom position
12 | None
13 | Silent
14 | Normal
15 | Vibration
16 | Priority only
17 | Total silence
18 | Alarms only
19 | Mute media
20 | Mute media when switching to silent
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-en-rCA/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Alert slider
8 | Action
9 | Top position
10 | Middle position
11 | Bottom position
12 | None
13 | Silent
14 | Normal
15 | Vibration
16 | Priority only
17 | Total silence
18 | Alarms only
19 | Mute media
20 | Mute media when switching to silent
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-en-rGB/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Alert slider
8 | Action
9 | Top position
10 | Middle position
11 | Bottom position
12 | None
13 | Silent
14 | Normal
15 | Vibration
16 | Priority only
17 | Total silence
18 | Alarms only
19 | Mute media
20 | Mute media when switching to silent
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-en-rIN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Alert slider
8 | Action
9 | Top position
10 | Middle position
11 | Bottom position
12 | None
13 | Silent
14 | Normal
15 | Vibration
16 | Priority only
17 | Total silence
18 | Alarms only
19 | Mute media
20 | Mute media when switching to silent
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Control deslizante de alertas
8 | Acción
9 | Posición superior
10 | Posición central
11 | Posición inferior
12 | Ninguno
13 | Silencio
14 | Normal
15 | Vibración
16 | Solo prioritarias
17 | Silencio total
18 | Solo alarmas
19 | Silenciar multimedia
20 | Silenciar multimedia al activar el modo silencio
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-fa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | نوار لغزنده هشدار
8 | عمل
9 | موقعیت بالا
10 | موقعیت وسط
11 | موقعیت پایین
12 | هیچ
13 | بیصدا
14 | عادی
15 | لرزش
16 | فقط اولویت ها
17 | سکوت کامل
18 | فقط هشدار ها
19 | رسانه بی صدا
20 | هنگام جابجایی به بیصدا، رسانه را بیصدا کنید
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-fi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Mykistä media
8 | Mykistä media kun vaihdetaan äänettömään tilaan.
9 |
10 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Curseur d\'alerte
8 | Action
9 | En haut
10 | Au milieu
11 | En bas
12 | Aucun
13 | Silencieux
14 | Normal
15 | Vibration
16 | Prioritaires uniquement
17 | Silence total
18 | Alarmes uniquement
19 | Couper le son du média
20 | Couper le son du média lors du passage en mode silencieux
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-fur-rIT/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Cursôr notifichis
8 | Azion
9 | Posizion superiôr
10 | Posizion centrâl
11 | Posizion inferiôr
12 | Nuie
13 | Cidin
14 | Normâl
15 | Vibrazion
16 | Dome prioritâts
17 | Cidin dal dut
18 | Dome sveis
19 | Cidine il multimedia
20 | Cidine i multimedia se tu passis ae modalitât cidine
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ga-rIE/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Sleamhnán rabhadh
8 | Gníomh
9 | Seasamh barr
10 | Seasamh meánach
11 | Seasamh bun
12 | Dada
13 | Ciúin
14 | Gnáth
15 | Creathadh
16 | Tosaíocht amháin
17 | Ciúnas iomlán
18 | Aláraim amháin
19 | Balbhaigh na meáin
20 | Balbhaigh na meáin agus tú ag aistriú chuig an gciúin
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-hu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Riasztási csúszka
8 | Művelet
9 | Felül
10 | Középen
11 | Alul
12 | Egyik sem
13 | Néma
14 | Normális
15 | Rezgés
16 | Csak a fontosak
17 | Teljes némítás
18 | Csak az ébresztések
19 | Médianémítás
20 | Médianémítás csendesre váltáskor
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-in/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Tindakan
8 | Posisi atas
9 | Posisi tengah
10 | Posisi bawah
11 | Tidak ada
12 | Senyap
13 | Normal
14 | Getaran
15 | Hanya prioritas
16 | Senyap total
17 | Hanya alarm
18 |
19 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-is/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Aðvaranasleði
8 | Aðgerð
9 | Staða efst
10 | Miðjustaða
11 | Staða neðst
12 | Ekkert
13 | Hljóðlaust
14 | Venjulegt
15 | Titringur
16 | Aðeins í forgangi
17 | Algjör þögn
18 | Aðeins áminningar
19 | Þagga niður margmiðlun
20 | Þagga niður efni þegar skipt er í hljóðlaust
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Slider notifiche
8 | Azione
9 | Posizione superiore
10 | Posizione centrale
11 | Posizione inferiore
12 | Niente
13 | Silenzioso
14 | Normale
15 | Vibrazione
16 | Solo priorità
17 | Silenzio totale
18 | Solo sveglie
19 | Silenzia media
20 | Silenzia i media quando si passa alla modalità silenziosa
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-iw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | מתג התראות
8 | פעולה
9 | ממוקם למעלה
10 | ממוקם באמצע
11 | ממוקם למטה
12 | ללא
13 | שקט
14 | רגיל
15 | רטט
16 | עדיפות בלבד
17 | מושתק לחלוטין
18 | שעון מעורר בלבד
19 | השתקת מדיה
20 | השתקת מדיה במעבר להשתקה
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | アラートスライダー
8 | 動作
9 | 上部
10 | 中央
11 | 下部
12 | なし
13 | サイレント
14 | 標準
15 | バイブ
16 | 重要な通知のみ
17 | 完全サイレント
18 | アラームのみ
19 | メディアをミュート
20 | サイレントモードに切り替えたときにメディア音量をミュートします
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ka/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | გაფრთხილების სრიალა
8 | მოქმედება
9 | ზედა მდებარეობა
10 | შუა მდებარეობა
11 | ქვედა მდებარეობა
12 | არცერთი
13 | უხმო
14 | ჩვეულებრივი
15 | ვიბრაცია
16 | მხოლოდ უპირატესი
17 | სრულიად უხმო
18 | მხოლოდ მაღვიძარები
19 | ფაილის დადუმება
20 | ფაილის დადუმება უხმოზე გადართვისას
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ko/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 알림 슬라이더
8 | 동작
9 | 슬라이더가 위쪽에 있을 때
10 | 슬라이더가 중간에 있을 때
11 | 슬라이더가 아래에 있을 때
12 | 없음
13 | 무음
14 | 기본
15 | 진동
16 | 중요 알림만
17 | 완전 무음
18 | 알람만
19 | 미디어 볼륨 음소거
20 | 무음으로 전환할 때 미디어 볼륨 음소거
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-nl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Schuifregelaar meldingen
8 | Actie
9 | Bovenste positie
10 | Middelste positie
11 | Onderste positie
12 | Geen
13 | Stil
14 | Normaal
15 | Trillen
16 | Alleen prioriteit
17 | Totale stilte
18 | Alleen alarmen
19 | Media dempen
20 | Media dempen bij overschakelen naar stil
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-pl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Suwak alarmowy
8 | Akcja
9 | Górna pozycja
10 | Środkowa pozycja
11 | Dolna pozycja
12 | Brak
13 | Cichy
14 | Normalny
15 | Wibracje
16 | Tylko priorytetowe
17 | Całkowita cisza
18 | Tylko alarmy
19 | Wycisz multimedia
20 | Wycisz multimedia po przełączeniu na Cichy
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-pt-rBR/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Controle deslizante de alerta
8 | Ação
9 | Em cima
10 | No centro
11 | Em baixo
12 | Nenhum
13 | Silencioso
14 | Normal
15 | Vibração
16 | Somente prioridade
17 | Silêncio total
18 | Somente alarmes
19 | Silenciar mídia
20 | Silenciar mídia ao mudar para o modo silencioso
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-pt-rPT/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Botão deslizante
8 | Ação
9 | Para cima
10 | No meio
11 | Em baixo
12 | Nenhum
13 | Silencioso
14 | Normal
15 | Vibração
16 | Apenas prioritárias
17 | Silêncio total
18 | Apenas alarmes
19 | Silenciar multimédia
20 | Silenciar multimédia ao ativar modo silencioso
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ro/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Alert slider
8 | Acțiune
9 | Sus
10 | Mijloc
11 | Jos
12 | Niciuna
13 | Silențios
14 | Normal
15 | Vibrație
16 | Numai cu prioritate
17 | Niciun sunet
18 | Numai alarme
19 | Fără sunet media
20 | Fără sunet media când se schimbă la silențios
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Переключатель оповещений
8 | Действие
9 | Верхнее положение
10 | Среднее положение
11 | Нижнее положение
12 | Ничего
13 | Без звука
14 | Обычный
15 | Вибрация
16 | Только важные
17 | Полная тишина
18 | Только будильник
19 | Выключить звук медиа
20 | Отключение звука мультимедиа при переключении на беззвучный режим
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-sl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Drsnik za opozorila
8 | Dejanje
9 | Zgornji položaj
10 | Srednji položaj
11 | Spodnji položaj
12 | Brez
13 | Tiho
14 | Običajno
15 | Vibriranje
16 | Samo prednostno
17 | Popolna tišina
18 | Samo budilke
19 | Utišaj predstavnost
20 | Utišaj predstavnost med preklapljanjem na tiho
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-sq/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Rrëshqitësi i alarmit
8 | Veprimi
9 | Pozicioni i lartë
10 | Pozicioni i mesëm
11 | Pozicioni i poshtëm
12 | Asnjë
13 | Pa zë
14 | Normal
15 | Dridhje
16 | Vetëm kryesoret
17 | Heshtje e plotë
18 | Vetëm alarmet
19 | Hesht median
20 | Hesht median kur kalon në heshtje
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-sv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Åtgärd
8 | Inget
9 | Normal
10 | Vibration
11 |
12 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ta/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | முதற் நிலை
8 | நடு நிலை
9 | கீழ் நிலை
10 |
11 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-tr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Uyarı kaydırıcısı
8 | Eylem
9 | Üst konum
10 | Orta konum
11 | Alt konum
12 | Hiçbiri
13 | Sessiz
14 | Normal
15 | Titreşim
16 | Sadece öncelik
17 | Tam sessizlik
18 | Yalnızca alarmlar
19 | Medyayı sustur
20 | Sessize geçerken medyayı sustur
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-ug/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | ئاگاھلاندۇرۇش سىيرىغۇچ
8 | مەشغۇلات
9 | چوققا نۇقتا
10 | ئوتتۇرا نۇقتا
11 | ئاستى نۇقتا
12 | يوق
13 | ئۈنسىز
14 | ئادەتتىكى
15 | تىترەت
16 | ئالدىنلىقلا
17 | تامامەن ئۈنسىز
18 | قوڭغۇراقلا
19 | ۋاسىتە ئۈنسىز
20 | ئۈنسىز ھالەتكە ئالماشتۇرغاندا ۋاسىتىنى ئۈنسىزلەيدۇ
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-vi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Thanh trượt cảnh báo
8 | Thao tác
9 | Vị trí trên cùng
10 | Vị trí giữa
11 | Vị trí dưới cùng
12 | Không có
13 | Im lặng
14 | Bình thường
15 | Rung
16 | Chỉ ưu tiên
17 | Hoàn toàn im lặng
18 | Chỉ báo thức
19 | Tắt tiếng phương tiện
20 | Tắt tiếng phương tiện khi chuyển sang chế độ im lặng
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 警报滑块
8 | 操作
9 | 顶部位置
10 | 中间位置
11 | 底部位置
12 | 无
13 | 静音
14 | 正常
15 | 振动
16 | 仅限优先
17 | 完全静音
18 | 仅限闹钟
19 | 静音,包括媒体音量
20 | 切换静音同时静音媒体
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 警示滑桿
8 | 動作
9 | 頂部位置
10 | 中間位置
11 | 底部位置
12 | 無
13 | 靜音
14 | 一般
15 | 震動
16 | 僅限優先
17 | 一律靜音
18 | 僅限鬧鐘
19 | 靜音,包括媒體
20 | 切換靜音時靜音媒體
21 |
22 |
--------------------------------------------------------------------------------
/KeyHandler/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | - @string/alert_slider_mode_none
9 | - @string/alert_slider_mode_normal
10 | - @string/alert_slider_mode_vibration
11 | - @string/alert_slider_mode_silent
12 | - @string/alert_slider_mode_dnd_priority_only
13 | - @string/alert_slider_mode_dnd_total_silence
14 | - @string/alert_slider_mode_dnd_alarms_only
15 |
16 |
17 |
18 | - -1
19 | - 2
20 | - 1
21 | - 0
22 | - 3
23 | - 4
24 | - 5
25 |
26 |
27 |
--------------------------------------------------------------------------------
/KeyHandler/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | Alert slider
9 | Action
10 | Top position
11 | Middle position
12 | Bottom position
13 | None
14 | Silent
15 | Normal
16 | Vibration
17 | Priority only
18 | Total silence
19 | Alarms only
20 | Mute media
21 | Mute media when switching to silent
22 |
23 |
--------------------------------------------------------------------------------
/KeyHandler/res/xml/button_panel.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
10 |
15 |
16 |
24 |
25 |
33 |
34 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/KeyHandler/src/org/lineageos/settings/device/BootCompletedReceiver.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | package org.lineageos.settings.device
7 |
8 | import android.content.BroadcastReceiver
9 | import android.content.Context
10 | import android.content.Intent
11 | import android.util.Log
12 |
13 | class BootCompletedReceiver : BroadcastReceiver() {
14 | override fun onReceive(context: Context, intent: Intent) {
15 | Log.d(TAG, "Starting")
16 | context.startService(Intent(context, KeyHandler::class.java))
17 | }
18 |
19 | companion object {
20 | private const val TAG = "KeyHandler"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/KeyHandler/src/org/lineageos/settings/device/ButtonSettingsActivity.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021-2024 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | package org.lineageos.settings.device
7 |
8 | import android.os.Bundle
9 |
10 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
11 |
12 | class ButtonSettingsActivity : CollapsingToolbarBaseActivity() {
13 | public override fun onCreate(savedInstanceState: Bundle?) {
14 | super.onCreate(savedInstanceState)
15 | fragmentManager.beginTransaction().replace(
16 | com.android.settingslib.collapsingtoolbar.R.id.content_frame,
17 | ButtonSettingsFragment()
18 | ).commit()
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/KeyHandler/src/org/lineageos/settings/device/ButtonSettingsFragment.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | package org.lineageos.settings.device
7 |
8 | import android.os.Bundle
9 | import android.view.MenuItem
10 | import androidx.preference.PreferenceFragment
11 |
12 | class ButtonSettingsFragment : PreferenceFragment() {
13 | override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
14 | addPreferencesFromResource(R.xml.button_panel)
15 | activity.actionBar!!.setDisplayHomeAsUpEnabled(true)
16 | }
17 |
18 | override fun addPreferencesFromResource(preferencesResId: Int) {
19 | super.addPreferencesFromResource(preferencesResId)
20 | }
21 |
22 | override fun onOptionsItemSelected(item: MenuItem): Boolean {
23 | when (item.itemId) {
24 | R.id.home -> {
25 | activity.finish()
26 | return true
27 | }
28 | }
29 | return super.onOptionsItemSelected(item)
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/KeyHandler/src/org/lineageos/settings/device/ConfigPanelSearchIndexablesProvider.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | package org.lineageos.settings.device
7 |
8 | import android.database.Cursor
9 | import android.database.MatrixCursor
10 | import android.provider.SearchIndexableResource
11 | import android.provider.SearchIndexablesProvider
12 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_CLASS_NAME
13 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_ICON_RESID
14 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_ACTION
15 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS
16 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE
17 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RANK
18 | import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RESID
19 | import android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS
20 | import android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS
21 | import android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS
22 |
23 | class ConfigPanelSearchIndexablesProvider : SearchIndexablesProvider() {
24 | override fun onCreate(): Boolean = true
25 |
26 | override fun queryXmlResources(projection: Array?): Cursor {
27 | val cursor = MatrixCursor(INDEXABLES_XML_RES_COLUMNS)
28 | INDEXABLE_RES.forEach {
29 | cursor.addRow(generateResourceRef(it))
30 | }
31 | return cursor
32 | }
33 |
34 | override fun queryRawData(projection: Array?): Cursor {
35 | return MatrixCursor(INDEXABLES_RAW_COLUMNS)
36 | }
37 |
38 | override fun queryNonIndexableKeys(projection: Array?): Cursor {
39 | return MatrixCursor(NON_INDEXABLES_KEYS_COLUMNS)
40 | }
41 |
42 | private fun generateResourceRef(sir: SearchIndexableResource): Array {
43 | val ref = arrayOfNulls(7)
44 | ref[COLUMN_INDEX_XML_RES_RANK] = sir.rank
45 | ref[COLUMN_INDEX_XML_RES_RESID] = sir.xmlResId
46 | ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null
47 | ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId
48 | ref[COLUMN_INDEX_XML_RES_INTENT_ACTION] = "com.android.settings.action.EXTRA_SETTINGS"
49 | ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "org.lineageos.settings.device"
50 | ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className
51 | return ref
52 | }
53 |
54 | companion object {
55 | private const val TAG = "ConfigPanelSearchIndexablesProvider"
56 |
57 | private val INDEXABLE_RES = arrayOf(
58 | SearchIndexableResource(
59 | 1, R.xml.button_panel, ButtonSettingsActivity::class.java.name, 0
60 | )
61 | )
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/KeyHandler/src/org/lineageos/settings/device/KeyHandler.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021-2023 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | package org.lineageos.settings.device
7 |
8 | import android.app.NotificationManager
9 | import android.app.Service
10 | import android.content.BroadcastReceiver
11 | import android.content.Context
12 | import android.content.Intent
13 | import android.content.IntentFilter
14 | import android.content.SharedPreferences
15 | import android.media.AudioManager
16 | import android.media.AudioSystem
17 | import android.os.IBinder
18 | import android.os.UEventObserver
19 | import android.os.VibrationAttributes
20 | import android.os.VibrationEffect
21 | import android.os.Vibrator
22 | import android.provider.Settings
23 | import androidx.preference.PreferenceManager
24 |
25 | import java.util.concurrent.Executors
26 |
27 | class KeyHandler : Service() {
28 | private lateinit var audioManager: AudioManager
29 | private lateinit var notificationManager: NotificationManager
30 | private lateinit var vibrator: Vibrator
31 | private lateinit var sharedPreferences: SharedPreferences
32 |
33 | private val executorService = Executors.newSingleThreadExecutor()
34 |
35 | private var wasMuted = false
36 | private val broadcastReceiver = object : BroadcastReceiver() {
37 | override fun onReceive(context: Context, intent: Intent) {
38 | val stream = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1)
39 | val state = intent.getBooleanExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, false)
40 | if (stream == AudioSystem.STREAM_MUSIC && !state) {
41 | wasMuted = false
42 | }
43 | }
44 | }
45 |
46 | private val alertSliderEventObserver = object : UEventObserver() {
47 | private val lock = Any()
48 |
49 | override fun onUEvent(event: UEvent) {
50 | synchronized(lock) {
51 | event.get("SWITCH_STATE")?.let {
52 | handleMode(it.toInt())
53 | return
54 | }
55 | event.get("STATE")?.let {
56 | val none = it.contains("USB=0")
57 | val vibration = it.contains("HOST=0")
58 | val silent = it.contains("null)=0")
59 |
60 | if (none && !vibration && !silent) {
61 | handleMode(POSITION_BOTTOM)
62 | } else if (!none && vibration && !silent) {
63 | handleMode(POSITION_MIDDLE)
64 | } else if (!none && !vibration && silent) {
65 | handleMode(POSITION_TOP)
66 | }
67 |
68 | return
69 | }
70 | }
71 | }
72 | }
73 |
74 | override fun onCreate() {
75 | audioManager = getSystemService(AudioManager::class.java)!!
76 | notificationManager = getSystemService(NotificationManager::class.java)!!
77 | vibrator = getSystemService(Vibrator::class.java)!!
78 | sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
79 |
80 | registerReceiver(
81 | broadcastReceiver,
82 | IntentFilter(AudioManager.STREAM_MUTE_CHANGED_ACTION)
83 | )
84 | alertSliderEventObserver.startObserving("tri-state-key")
85 | alertSliderEventObserver.startObserving("tri_state_key")
86 | }
87 |
88 | override fun onBind(intent: Intent?): IBinder? = null
89 |
90 | private fun vibrateIfNeeded(mode: Int) {
91 | when (mode) {
92 | AudioManager.RINGER_MODE_VIBRATE -> vibrator.vibrate(
93 | MODE_VIBRATION_EFFECT,
94 | HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES
95 | )
96 | AudioManager.RINGER_MODE_NORMAL -> vibrator.vibrate(
97 | MODE_NORMAL_EFFECT,
98 | HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES
99 | )
100 | }
101 | }
102 |
103 | private fun handleMode(position: Int) {
104 | val muteMedia = sharedPreferences.getBoolean(MUTE_MEDIA_WITH_SILENT, false)
105 |
106 | val mode = when (position) {
107 | POSITION_TOP -> sharedPreferences.getString(ALERT_SLIDER_TOP_KEY, "0")!!.toInt()
108 | POSITION_MIDDLE -> sharedPreferences.getString(ALERT_SLIDER_MIDDLE_KEY, "1")!!.toInt()
109 | POSITION_BOTTOM -> sharedPreferences.getString(ALERT_SLIDER_BOTTOM_KEY, "2")!!.toInt()
110 | else -> return
111 | }
112 |
113 | executorService.submit {
114 | when (mode) {
115 | AudioManager.RINGER_MODE_SILENT -> {
116 | setZenMode(Settings.Global.ZEN_MODE_OFF)
117 | audioManager.ringerModeInternal = mode
118 | if (muteMedia) {
119 | audioManager.adjustVolume(AudioManager.ADJUST_MUTE, 0)
120 | wasMuted = true
121 | }
122 | }
123 | AudioManager.RINGER_MODE_VIBRATE, AudioManager.RINGER_MODE_NORMAL -> {
124 | setZenMode(Settings.Global.ZEN_MODE_OFF)
125 | audioManager.ringerModeInternal = mode
126 | if (muteMedia && wasMuted) {
127 | audioManager.adjustVolume(AudioManager.ADJUST_UNMUTE, 0)
128 | }
129 | }
130 | ZEN_PRIORITY_ONLY, ZEN_TOTAL_SILENCE, ZEN_ALARMS_ONLY -> {
131 | audioManager.ringerModeInternal = AudioManager.RINGER_MODE_NORMAL
132 | setZenMode(mode - ZEN_OFFSET)
133 | if (muteMedia && wasMuted) {
134 | audioManager.adjustVolume(AudioManager.ADJUST_UNMUTE, 0)
135 | }
136 | }
137 | }
138 | vibrateIfNeeded(mode)
139 | }
140 | }
141 |
142 | private fun setZenMode(zenMode: Int) {
143 | // Set zen mode
144 | notificationManager.setZenMode(zenMode, null, TAG)
145 |
146 | // Wait until zen mode change is committed
147 | while (notificationManager.zenMode != zenMode) {
148 | Thread.sleep(10)
149 | }
150 | }
151 |
152 | companion object {
153 | private const val TAG = "KeyHandler"
154 |
155 | // Slider key positions
156 | private const val POSITION_TOP = 1
157 | private const val POSITION_MIDDLE = 2
158 | private const val POSITION_BOTTOM = 3
159 |
160 | // Preference keys
161 | private const val ALERT_SLIDER_TOP_KEY = "config_top_position"
162 | private const val ALERT_SLIDER_MIDDLE_KEY = "config_middle_position"
163 | private const val ALERT_SLIDER_BOTTOM_KEY = "config_bottom_position"
164 | private const val MUTE_MEDIA_WITH_SILENT = "config_mute_media"
165 |
166 | // ZEN constants
167 | private const val ZEN_OFFSET = 2
168 | private const val ZEN_PRIORITY_ONLY = 3
169 | private const val ZEN_TOTAL_SILENCE = 4
170 | private const val ZEN_ALARMS_ONLY = 5
171 |
172 | // Vibration attributes
173 | private val HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES =
174 | VibrationAttributes.createForUsage(VibrationAttributes.USAGE_HARDWARE_FEEDBACK)
175 |
176 | // Vibration effects
177 | private val MODE_NORMAL_EFFECT = VibrationEffect.get(VibrationEffect.EFFECT_HEAVY_CLICK)
178 | private val MODE_VIBRATION_EFFECT = VibrationEffect.get(VibrationEffect.EFFECT_DOUBLE_CLICK)
179 | }
180 | }
181 |
--------------------------------------------------------------------------------
/KeyHandler/tri-state-key-calibrate.rc:
--------------------------------------------------------------------------------
1 | service vendor.tri-state-key-calibrate /vendor/bin/tri-state-key-calibrate
2 | class main
3 | user system
4 | group system
5 | oneshot
6 | disabled
7 |
8 | on post-fs-data
9 | start vendor.tri-state-key-calibrate
10 |
--------------------------------------------------------------------------------
/KeyHandler/tri-state-key-calibrate.sh:
--------------------------------------------------------------------------------
1 | #!/vendor/bin/sh
2 | if [[ -f /mnt/vendor/persist/engineermode/tri_state_hall_data ]]; then
3 | CALIBRATION_DATA="$(cat /mnt/vendor/persist/engineermode/tri_state_hall_data)"
4 | CALIBRATION_DATA="${CALIBRATION_DATA//;/,}"
5 | echo -n $CALIBRATION_DATA > /sys/devices/platform/soc/soc:tri_state_key/hall_data_calib
6 | fi
7 |
--------------------------------------------------------------------------------
/aidl/livedisplay/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | filegroup {
7 | name: "vendor.lineage.livedisplay-oneplus-af",
8 | srcs: ["AntiFlicker.cpp"],
9 | }
10 |
11 | filegroup {
12 | name: "vendor.lineage.livedisplay-oneplus-se",
13 | srcs: ["SunlightEnhancement.cpp"],
14 | }
15 |
16 | cc_library_headers {
17 | name: "vendor.lineage.livedisplay-oneplus-headers",
18 | vendor_available: true,
19 | export_include_dirs: ["include"],
20 | }
21 |
22 | cc_binary {
23 | name: "vendor.lineage.livedisplay-service.oneplus",
24 | init_rc: ["vendor.lineage.livedisplay-service.oneplus.rc"],
25 | vintf_fragments: select(soong_config_variable("ONEPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AF"), {
26 | "false": [],
27 | default: ["vendor.lineage.livedisplay-service.oneplus-af.xml"],
28 | }) + select(soong_config_variable("ONEPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_PA"), {
29 | "false": [],
30 | default: ["vendor.lineage.livedisplay-service.oneplus-pa.xml"],
31 | }) + select(soong_config_variable("ONEPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_SE"), {
32 | "false": [],
33 | default: ["vendor.lineage.livedisplay-service.oneplus-se.xml"],
34 | }),
35 | relative_install_path: "hw",
36 | srcs: [
37 | ":vendor.lineage.livedisplay-sdm-pa",
38 | ":vendor.lineage.livedisplay-sdm-utils",
39 | ":vendor.lineage.livedisplay-oneplus-af",
40 | ":vendor.lineage.livedisplay-oneplus-se",
41 | "service.cpp",
42 | ],
43 | shared_libs: [
44 | "libbase",
45 | "libbinder_ndk",
46 | "libbinder",
47 | "libutils",
48 | "vendor.lineage.livedisplay-V1-ndk",
49 | ],
50 | header_libs: [
51 | "vendor.lineage.livedisplay-sdm-headers",
52 | "vendor.lineage.livedisplay-oneplus-headers",
53 | ],
54 | cflags: select(soong_config_variable("ONEPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AF"), {
55 | "false": ["-DENABLE_AF=false"],
56 | default: ["-DENABLE_AF=true"],
57 | }) + select(soong_config_variable("ONEPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_PA"), {
58 | "false": ["-DENABLE_PA=false"],
59 | default: ["-DENABLE_PA=true"],
60 | }) + select(soong_config_variable("ONEPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_SE"), {
61 | "false": ["-DENABLE_SE=false"],
62 | default: ["-DENABLE_SE=true"],
63 | }),
64 | proprietary: true,
65 | }
66 |
--------------------------------------------------------------------------------
/aidl/livedisplay/AntiFlicker.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #define LOG_TAG "AntiFlickerService"
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | namespace aidl {
13 | namespace vendor {
14 | namespace lineage {
15 | namespace livedisplay {
16 |
17 | static constexpr const char* kDcDimmingPath = "/sys/class/drm/card0-DSI-1/dimlayer_bl_en";
18 |
19 | ndk::ScopedAStatus AntiFlicker::getEnabled(bool* _aidl_return) {
20 | std::ifstream file(kDcDimmingPath);
21 | int result = -1;
22 | if (file.fail()) {
23 | return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
24 | }
25 | file >> result;
26 | LOG(DEBUG) << "Got result " << result << " fail " << file.fail();
27 | *_aidl_return = result > 0;
28 | return ndk::ScopedAStatus::ok();
29 | }
30 |
31 | ndk::ScopedAStatus AntiFlicker::setEnabled(bool enabled) {
32 | std::ofstream file(kDcDimmingPath);
33 | file << (enabled ? "1" : "0");
34 | if (file.fail()) {
35 | LOG(DEBUG) << "setEnabled fail " << file.fail();
36 | return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
37 | }
38 | return ndk::ScopedAStatus::ok();
39 | }
40 |
41 | } // namespace livedisplay
42 | } // namespace lineage
43 | } // namespace vendor
44 | } // namespace aidl
45 |
--------------------------------------------------------------------------------
/aidl/livedisplay/SunlightEnhancement.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #define LOG_TAG "SunlightEnhancementService"
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | namespace aidl {
13 | namespace vendor {
14 | namespace lineage {
15 | namespace livedisplay {
16 |
17 | static constexpr const char* kHbmPath = "/sys/class/drm/card0-DSI-1/hbm";
18 |
19 | ndk::ScopedAStatus SunlightEnhancement::getEnabled(bool* _aidl_return) {
20 | std::ifstream file(kHbmPath);
21 | int result = -1;
22 | if (file.fail()) {
23 | return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
24 | }
25 | file >> result;
26 | LOG(DEBUG) << "Got result " << result << " fail " << file.fail();
27 | *_aidl_return = result > 0;
28 | return ndk::ScopedAStatus::ok();
29 | }
30 |
31 | ndk::ScopedAStatus SunlightEnhancement::setEnabled(bool enabled) {
32 | std::ofstream file(kHbmPath);
33 | file << (enabled ? "5" : "0");
34 | if (file.fail()) {
35 | LOG(DEBUG) << "setEnabled fail " << file.fail();
36 | return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
37 | }
38 | return ndk::ScopedAStatus::ok();
39 | }
40 |
41 | } // namespace livedisplay
42 | } // namespace lineage
43 | } // namespace vendor
44 | } // namespace aidl
45 |
--------------------------------------------------------------------------------
/aidl/livedisplay/include/livedisplay/oneplus/AntiFlicker.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 |
10 | namespace aidl {
11 | namespace vendor {
12 | namespace lineage {
13 | namespace livedisplay {
14 |
15 | class AntiFlicker : public BnAntiFlicker {
16 | // Methods from ::aidl::vendor::lineage::livedisplay::BnAntiFlicker follow.
17 | ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
18 | ndk::ScopedAStatus setEnabled(bool enabled) override;
19 | };
20 |
21 | } // namespace livedisplay
22 | } // namespace lineage
23 | } // namespace vendor
24 | } // namespace aidl
25 |
--------------------------------------------------------------------------------
/aidl/livedisplay/include/livedisplay/oneplus/SunlightEnhancement.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 |
10 | namespace aidl {
11 | namespace vendor {
12 | namespace lineage {
13 | namespace livedisplay {
14 |
15 | class SunlightEnhancement : public BnSunlightEnhancement {
16 | // Methods from ::aidl::vendor::lineage::livedisplay::BnSunlightEnhancement follow.
17 | ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
18 | ndk::ScopedAStatus setEnabled(bool enabled) override;
19 | };
20 |
21 | } // namespace livedisplay
22 | } // namespace lineage
23 | } // namespace vendor
24 | } // namespace aidl
25 |
--------------------------------------------------------------------------------
/aidl/livedisplay/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #define LOG_TAG "vendor.lineage.livedisplay-service-oneplus"
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | using ::aidl::vendor::lineage::livedisplay::AntiFlicker;
17 | using ::aidl::vendor::lineage::livedisplay::SunlightEnhancement;
18 | using ::aidl::vendor::lineage::livedisplay::sdm::PictureAdjustment;
19 | using ::aidl::vendor::lineage::livedisplay::sdm::SDMController;
20 |
21 | int main() {
22 | android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
23 | android::ProcessState::self()->startThreadPool();
24 |
25 | LOG(INFO) << "LiveDisplay HAL service is starting.";
26 |
27 | std::shared_ptr controller =
28 | ENABLE_PA ? std::make_shared() : nullptr;
29 |
30 | std::shared_ptr af = ENABLE_AF ? ndk::SharedRefBase::make() : nullptr;
31 | std::shared_ptr pa =
32 | ENABLE_PA ? ndk::SharedRefBase::make(controller) : nullptr;
33 | std::shared_ptr se =
34 | ENABLE_SE ? ndk::SharedRefBase::make() : nullptr;
35 |
36 | if (af) {
37 | std::string instance = std::string() + AntiFlicker::descriptor + "/default";
38 | binder_status_t status = AServiceManager_addService(af->asBinder().get(), instance.c_str());
39 | CHECK_EQ(status, STATUS_OK);
40 | }
41 |
42 | if (pa) {
43 | std::string instance = std::string() + PictureAdjustment::descriptor + "/default";
44 | binder_status_t status = AServiceManager_addService(pa->asBinder().get(), instance.c_str());
45 | CHECK_EQ(status, STATUS_OK);
46 | }
47 |
48 | if (se) {
49 | std::string instance = std::string() + SunlightEnhancement::descriptor + "/default";
50 | binder_status_t status = AServiceManager_addService(se->asBinder().get(), instance.c_str());
51 | CHECK_EQ(status, STATUS_OK);
52 | }
53 |
54 | ABinderProcess_joinThreadPool();
55 | return EXIT_FAILURE; // should not reach
56 | }
57 |
--------------------------------------------------------------------------------
/aidl/livedisplay/vendor.lineage.livedisplay-service.oneplus-af.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vendor.lineage.livedisplay
4 | 1
5 |
6 | IAntiFlicker
7 | default
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/aidl/livedisplay/vendor.lineage.livedisplay-service.oneplus-pa.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vendor.lineage.livedisplay
4 | 1
5 |
6 | IPictureAdjustment
7 | default
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/aidl/livedisplay/vendor.lineage.livedisplay-service.oneplus-se.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vendor.lineage.livedisplay
4 | 1
5 |
6 | ISunlightEnhancement
7 | default
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/aidl/livedisplay/vendor.lineage.livedisplay-service.oneplus.rc:
--------------------------------------------------------------------------------
1 | on init
2 | chown system graphics /sys/class/drm/card0-DSI-1/dimlayer_bl_en
3 | chown system graphics /sys/class/drm/card0-DSI-1/hbm
4 | chmod 0666 /sys/class/drm/card0-DSI-1/dimlayer_bl_en
5 | chmod 0666 /sys/class/drm/card0-DSI-1/hbm
6 |
7 | service vendor.livedisplay-hal /vendor/bin/hw/vendor.lineage.livedisplay-service.oneplus
8 | class late_start
9 | user system
10 | group system
11 |
--------------------------------------------------------------------------------
/aidl/touch/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // SPDX-FileCopyrightText: 2025 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | filegroup {
7 | name: "vendor.lineage.touch-oneplus-touchgesture",
8 | srcs: ["TouchscreenGesture.cpp"],
9 | }
10 |
11 | cc_library_headers {
12 | name: "vendor.lineage.touch-oneplus-headers",
13 | vendor_available: true,
14 | export_include_dirs: ["."],
15 | }
16 |
17 | cc_binary {
18 | name: "vendor.lineage.touch-service.oneplus",
19 | init_rc: ["vendor.lineage.touch-service.oneplus.rc"],
20 | vintf_fragments: ["vendor.lineage.touch-service.oneplus.xml"],
21 | vendor: true,
22 | relative_install_path: "hw",
23 | srcs: [
24 | ":vendor.lineage.touch-oneplus-touchgesture",
25 | "service.cpp",
26 | ],
27 | shared_libs: [
28 | "libbase",
29 | "liblog",
30 | "libbinder_ndk",
31 | "libutils",
32 | "vendor.lineage.touch-V1-ndk",
33 | ],
34 | header_libs: [
35 | "vendor.lineage.touch-oneplus-headers",
36 | ],
37 | include_dirs: select(soong_config_variable("ONEPLUS_LINEAGE_TOUCH_HAL", "INCLUDE_DIR"), {
38 | any @ flag_val: [flag_val],
39 | default: [],
40 | }),
41 | }
42 |
--------------------------------------------------------------------------------
/aidl/touch/TouchscreenGesture.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #define LOG_TAG "TouchscreenGestureService"
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | namespace aidl {
14 | namespace vendor {
15 | namespace lineage {
16 | namespace touch {
17 |
18 | ndk::ScopedAStatus TouchscreenGesture::getSupportedGestures(std::vector* _aidl_return) {
19 | std::vector gestures;
20 |
21 | for (const auto& entry : kGestureInfoMap) {
22 | if (access(entry.second.path, F_OK) != -1) {
23 | gestures.push_back({entry.first, entry.second.name, entry.second.keycode});
24 | }
25 | }
26 |
27 | *_aidl_return = gestures;
28 | return ndk::ScopedAStatus::ok();
29 | }
30 |
31 | ndk::ScopedAStatus TouchscreenGesture::setGestureEnabled(const Gesture& gesture, bool enabled) {
32 | const auto entry = kGestureInfoMap.find(gesture.id);
33 | if (entry == kGestureInfoMap.end()) {
34 | return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
35 | }
36 |
37 | std::ofstream file(entry->second.path);
38 | file << (enabled ? "1" : "0");
39 | LOG(DEBUG) << "Wrote file " << entry->second.path << " fail " << file.fail();
40 |
41 | return ndk::ScopedAStatus::ok();
42 | }
43 |
44 | } // namespace touch
45 | } // namespace lineage
46 | } // namespace vendor
47 | } // namespace aidl
48 |
--------------------------------------------------------------------------------
/aidl/touch/TouchscreenGesture.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 | #include