summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArian <arian.kulmer@web.de>2021-01-03 16:49:50 +0100
committerBruno Martins <bgcngm@gmail.com>2021-01-07 17:24:01 +0000
commit056187e74f7af76babc18f92ee647b6d69d5fe1c (patch)
treebb93a9d8b1d692c6d8bc8e5f6925007360c3ffe7
parent54d862cac42fd74fb462d8c554d66a1e9d08663d (diff)
LineageHardwareManager: Introduce keys swap feature support
Change-Id: I789814d780b06b146c1f9ab62293f4d6ca287208
-rw-r--r--api/lineage_current.txt1
-rw-r--r--sdk/src/java/lineageos/hardware/LineageHardwareManager.java18
2 files changed, 18 insertions, 1 deletions
diff --git a/api/lineage_current.txt b/api/lineage_current.txt
index 13e70b33..4570052c 100644
--- a/api/lineage_current.txt
+++ b/api/lineage_current.txt
@@ -203,6 +203,7 @@ package lineageos.hardware {
field public static final int FEATURE_DISPLAY_MODES = 8192; // 0x2000
field public static final int FEATURE_HIGH_TOUCH_SENSITIVITY = 16; // 0x10
field public static final int FEATURE_KEY_DISABLE = 32; // 0x20
+ field public static final int FEATURE_KEY_SWAP = 64; // 0x40
field public static final int FEATURE_PICTURE_ADJUSTMENT = 262144; // 0x40000
field public static final int FEATURE_READING_ENHANCEMENT = 16384; // 0x4000
field public static final int FEATURE_SUNLIGHT_ENHANCEMENT = 256; // 0x100
diff --git a/sdk/src/java/lineageos/hardware/LineageHardwareManager.java b/sdk/src/java/lineageos/hardware/LineageHardwareManager.java
index 4c6793ff..c912b80c 100644
--- a/sdk/src/java/lineageos/hardware/LineageHardwareManager.java
+++ b/sdk/src/java/lineageos/hardware/LineageHardwareManager.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015-2016 The CyanogenMod Project
- * 2017-2019 The LineageOS Project
+ * 2017-2021 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,6 +41,7 @@ import vendor.lineage.livedisplay.V2_0.IReadingEnhancement;
import vendor.lineage.livedisplay.V2_0.ISunlightEnhancement;
import vendor.lineage.touch.V1_0.IGloveMode;
import vendor.lineage.touch.V1_0.IKeyDisabler;
+import vendor.lineage.touch.V1_0.IKeySwapper;
import vendor.lineage.touch.V1_0.IStylusMode;
import vendor.lineage.touch.V1_0.ITouchscreenGesture;
@@ -98,6 +99,12 @@ public final class LineageHardwareManager {
public static final int FEATURE_KEY_DISABLE = 0x20;
/**
+ * Hardware navigation key swapping
+ */
+ @VisibleForTesting
+ public static final int FEATURE_KEY_SWAP = 0x40;
+
+ /**
* Increased display readability in bright light
*/
@VisibleForTesting
@@ -157,6 +164,7 @@ public final class LineageHardwareManager {
FEATURE_COLOR_ENHANCEMENT,
FEATURE_HIGH_TOUCH_SENSITIVITY,
FEATURE_KEY_DISABLE,
+ FEATURE_KEY_SWAP,
FEATURE_SUNLIGHT_ENHANCEMENT,
FEATURE_TOUCH_HOVERING,
FEATURE_READING_ENHANCEMENT
@@ -284,6 +292,8 @@ public final class LineageHardwareManager {
return IGloveMode.getService(true);
case FEATURE_KEY_DISABLE:
return IKeyDisabler.getService(true);
+ case FEATURE_KEY_SWAP:
+ return IKeySwapper.getService(true);
case FEATURE_TOUCH_HOVERING:
return IStylusMode.getService(true);
case FEATURE_TOUCHSCREEN_GESTURES:
@@ -347,6 +357,9 @@ public final class LineageHardwareManager {
case FEATURE_KEY_DISABLE:
IKeyDisabler keyDisabler = (IKeyDisabler) obj;
return keyDisabler.isEnabled();
+ case FEATURE_KEY_SWAP:
+ IKeySwapper keySwapper = (IKeySwapper) obj;
+ return keySwapper.isEnabled();
case FEATURE_SUNLIGHT_ENHANCEMENT:
ISunlightEnhancement sunlightEnhancement = (ISunlightEnhancement) obj;
return sunlightEnhancement.isEnabled();
@@ -399,6 +412,9 @@ public final class LineageHardwareManager {
case FEATURE_KEY_DISABLE:
IKeyDisabler keyDisabler = (IKeyDisabler) obj;
return keyDisabler.setEnabled(enable);
+ case FEATURE_KEY_SWAP:
+ IKeySwapper keySwapper = (IKeySwapper) obj;
+ return keySwapper.setEnabled(enable);
case FEATURE_SUNLIGHT_ENHANCEMENT:
ISunlightEnhancement sunlightEnhancement = (ISunlightEnhancement) obj;
return sunlightEnhancement.setEnabled(enable);