Loading res/values/arrays.xml +2 −0 Original line number Diff line number Diff line Loading @@ -384,6 +384,7 @@ <item>@string/touchscreen_gesture_action_next_track</item> <item>@string/touchscreen_gesture_action_volume_down</item> <item>@string/touchscreen_gesture_action_volume_up</item> <item>@string/touchscreen_gesture_action_ambient_display</item> </string-array> <string-array name="touchscreen_gesture_action_values"> Loading @@ -399,6 +400,7 @@ <item>9</item> <item>10</item> <item>11</item> <item>12</item> </string-array> <string-array name="torch_long_press_power_timeout_entries" translatable="false"> Loading res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -613,6 +613,7 @@ <string name="touchscreen_gesture_one_finger_down_swipe_title">Swipe down with one finger</string> <string name="touchscreen_gesture_one_finger_left_swipe_title">Swipe left with one finger</string> <string name="touchscreen_gesture_one_finger_right_swipe_title">Swipe right with one finger</string> <string name="touchscreen_gesture_single_tap_title">Single tap</string> <string name="touchscreen_gesture_up_arrow_title">Draw a \"Λ\"</string> <string name="touchscreen_gesture_down_arrow_title">Draw a \"V\"</string> <string name="touchscreen_gesture_left_arrow_title">Draw a \"<\"</string> Loading Loading @@ -646,6 +647,7 @@ <string name="touchscreen_gesture_action_next_track">Skip to the next music track</string> <string name="touchscreen_gesture_action_volume_down">Lower media volume</string> <string name="touchscreen_gesture_action_volume_up">Raise media volume</string> <string name="touchscreen_gesture_action_ambient_display">Show ambient display</string> <!-- Egg: Title for the easter egg activity --> <string name="egg_title" translatable="false">LineageOS Easter Egg</string> Loading src/org/lineageos/lineageparts/gestures/KeyHandler.java +15 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class KeyHandler implements DeviceKeyHandler { private static final String TAG = KeyHandler.class.getSimpleName(); private static final String GESTURE_WAKEUP_REASON = "lineageparts-gesture-wakeup"; private static final String PULSE_ACTION = "com.android.systemui.doze.pulse"; private static final int GESTURE_REQUEST = 0; private static final int GESTURE_WAKELOCK_DURATION = 3000; private static final int EVENT_PROCESS_WAKELOCK_DURATION = 500; Loading Loading @@ -244,6 +245,9 @@ public class KeyHandler implements DeviceKeyHandler { case TouchscreenGestureConstants.ACTION_VOLUME_UP: volumeUp(); break; case TouchscreenGestureConstants.ACTION_AMBIENT_DISPLAY: launchDozePulse(); break; } } } Loading Loading @@ -332,6 +336,17 @@ public class KeyHandler implements DeviceKeyHandler { doHapticFeedback(); } private void launchDozePulse() { final boolean dozeEnabled = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.DOZE_ENABLED, 1) != 0; if (dozeEnabled) { mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION); final Intent intent = new Intent(PULSE_ACTION); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); doHapticFeedback(); } } private void dispatchMediaKeyWithWakeLockToMediaSession(final int keycode) { final MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext); if (helper == null) { Loading src/org/lineageos/lineageparts/gestures/TouchscreenGestureConstants.java +1 −0 Original line number Diff line number Diff line Loading @@ -37,4 +37,5 @@ class TouchscreenGestureConstants { static final int ACTION_NEXT_TRACK = 9; static final int ACTION_VOLUME_DOWN = 10; static final int ACTION_VOLUME_UP = 11; static final int ACTION_AMBIENT_DISPLAY = 12; } Loading
res/values/arrays.xml +2 −0 Original line number Diff line number Diff line Loading @@ -384,6 +384,7 @@ <item>@string/touchscreen_gesture_action_next_track</item> <item>@string/touchscreen_gesture_action_volume_down</item> <item>@string/touchscreen_gesture_action_volume_up</item> <item>@string/touchscreen_gesture_action_ambient_display</item> </string-array> <string-array name="touchscreen_gesture_action_values"> Loading @@ -399,6 +400,7 @@ <item>9</item> <item>10</item> <item>11</item> <item>12</item> </string-array> <string-array name="torch_long_press_power_timeout_entries" translatable="false"> Loading
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -613,6 +613,7 @@ <string name="touchscreen_gesture_one_finger_down_swipe_title">Swipe down with one finger</string> <string name="touchscreen_gesture_one_finger_left_swipe_title">Swipe left with one finger</string> <string name="touchscreen_gesture_one_finger_right_swipe_title">Swipe right with one finger</string> <string name="touchscreen_gesture_single_tap_title">Single tap</string> <string name="touchscreen_gesture_up_arrow_title">Draw a \"Λ\"</string> <string name="touchscreen_gesture_down_arrow_title">Draw a \"V\"</string> <string name="touchscreen_gesture_left_arrow_title">Draw a \"<\"</string> Loading Loading @@ -646,6 +647,7 @@ <string name="touchscreen_gesture_action_next_track">Skip to the next music track</string> <string name="touchscreen_gesture_action_volume_down">Lower media volume</string> <string name="touchscreen_gesture_action_volume_up">Raise media volume</string> <string name="touchscreen_gesture_action_ambient_display">Show ambient display</string> <!-- Egg: Title for the easter egg activity --> <string name="egg_title" translatable="false">LineageOS Easter Egg</string> Loading
src/org/lineageos/lineageparts/gestures/KeyHandler.java +15 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class KeyHandler implements DeviceKeyHandler { private static final String TAG = KeyHandler.class.getSimpleName(); private static final String GESTURE_WAKEUP_REASON = "lineageparts-gesture-wakeup"; private static final String PULSE_ACTION = "com.android.systemui.doze.pulse"; private static final int GESTURE_REQUEST = 0; private static final int GESTURE_WAKELOCK_DURATION = 3000; private static final int EVENT_PROCESS_WAKELOCK_DURATION = 500; Loading Loading @@ -244,6 +245,9 @@ public class KeyHandler implements DeviceKeyHandler { case TouchscreenGestureConstants.ACTION_VOLUME_UP: volumeUp(); break; case TouchscreenGestureConstants.ACTION_AMBIENT_DISPLAY: launchDozePulse(); break; } } } Loading Loading @@ -332,6 +336,17 @@ public class KeyHandler implements DeviceKeyHandler { doHapticFeedback(); } private void launchDozePulse() { final boolean dozeEnabled = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.DOZE_ENABLED, 1) != 0; if (dozeEnabled) { mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION); final Intent intent = new Intent(PULSE_ACTION); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); doHapticFeedback(); } } private void dispatchMediaKeyWithWakeLockToMediaSession(final int keycode) { final MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext); if (helper == null) { Loading
src/org/lineageos/lineageparts/gestures/TouchscreenGestureConstants.java +1 −0 Original line number Diff line number Diff line Loading @@ -37,4 +37,5 @@ class TouchscreenGestureConstants { static final int ACTION_NEXT_TRACK = 9; static final int ACTION_VOLUME_DOWN = 10; static final int ACTION_VOLUME_UP = 11; static final int ACTION_AMBIENT_DISPLAY = 12; }