summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorezio84 <brabus84@gmail.com>2021-10-21 18:07:40 +0000
committeralk3pInjection <webmaster@raspii.tech>2022-05-07 00:20:58 +0800
commite5cd9a84d44f8e02be93e8bc142510670884e91d (patch)
tree33d735efa6ff5f5171c20be78d9e44155b1cbc4e /core
parent2a071c3fd6f87e1a54e9e975804b8ab800e0a791 (diff)
base: Long press power button to toggle flashlight [1/2]
* Thanks to beanstown106 for the initial longpress action calls in PhoneWindowManager (improved by lineage guys) * Remove the settings pref if the device doesn't have flashlight * Vibrate when toggling torch to let the user know of unwanted toggling in the pocket (even if vibration is disabled by user) * Allow torch action also on ambient display [AEX Edits] : - Port to S - simplify code [mydongistiny]: - Fixed for android10 [DennySPB] : - base: ScreenOff torch: Allow to disable torch when screen is on [mickaelmendes50] : - Adapt to AOSPA * We don't allow users to use the Double Press power option, so remove the non used code. * Removed "double press power to toggle torch" * Removed "handle camera gesture here instead of extensions" * Removed "Add 170ms delay for double tap action" Change-Id: I12da044f86c7b625872607529cf8524615cf576b
Diffstat (limited to 'core')
-rw-r--r--core/java/android/provider/Settings.java10
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBar.aidl5
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBarService.aidl5
3 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 64173d5ee713..a0e38844a81a 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5228,6 +5228,16 @@ public final class Settings {
public static final String VOLBTN_MUSIC_CONTROLS = "volbtn_music_controls";
/**
+ * Whether the torch launch gesture to double tap or long press the power button when the
+ * screen is off should be enabled. *
+ * 0: disabled
+ * 1: double tap power for torch
+ * 2: long tap power for torch
+ * @hide
+ */
+ public static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture";
+
+ /**
* Keys we no longer back up under the current schema, but want to continue to
* process when restoring historical backup datasets.
*
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index ad4f280b1e8d..86ccd2e0e17c 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -288,4 +288,9 @@ oneway interface IStatusBar
* Triggers a GC in the system and status bar.
*/
void runGcForTest();
+
+ /**
+ * Toggles flashlight of the device
+ */
+ void toggleCameraFlash();
}
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index fd28d1be8106..44c530972409 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -162,4 +162,9 @@ interface IStatusBarService
* Starts the default assistant app.
*/
void startAssist(in Bundle args);
+
+ /**
+ * Toggles flashlight of the device
+ */
+ void toggleCameraFlash();
}