OPlusExtras: Adapt to Lineage

Change paths required for touch gesture functionality according to LineageOS Source
This commit is contained in:
Manidweep
2025-01-28 16:01:51 -05:00
parent 7c8ee0e5c3
commit 2c21b64961
3 changed files with 14 additions and 7 deletions

View File

@@ -23,6 +23,8 @@ android_app {
static_libs: [
"androidx.core_core",
"androidx.preference_preference",
"org.lineageos.platform.internal",
"org.lineageos.settings.resources",
"particles",
],

View File

@@ -36,6 +36,8 @@ import android.view.KeyEvent;
import com.android.internal.os.DeviceKeyHandler;
import lineageos.providers.LineageSettings;
public class KeyHandler implements DeviceKeyHandler {
private static final String TAG = KeyHandler.class.getSimpleName();
@@ -229,7 +231,7 @@ public class KeyHandler implements DeviceKeyHandler {
private void launchCamera() {
mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION);
final Intent intent = new Intent(android.content.Intent.ACTION_SCREEN_CAMERA_GESTURE);
final Intent intent = new Intent(lineageos.content.Intent.ACTION_SCREEN_CAMERA_GESTURE);
mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT,
Manifest.permission.STATUS_BAR_SERVICE);
doHapticFeedback();
@@ -317,10 +319,13 @@ public class KeyHandler implements DeviceKeyHandler {
return;
}
final boolean enabled = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.TOUCHSCREEN_GESTURE_HAPTIC_FEEDBACK, 1) != 0;
if (enabled) {
mVibrator.vibrate(VibrationEffect.get(VibrationEffect.EFFECT_CLICK));
if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT) {
final boolean enabled = LineageSettings.System.getInt(mContext.getContentResolver(),
LineageSettings.System.TOUCHSCREEN_GESTURE_HAPTIC_FEEDBACK, 1) != 0;
if (enabled) {
mVibrator.vibrate(VibrationEffect.createOneShot(50,
VibrationEffect.DEFAULT_AMPLITUDE));
}
}
}

View File

@@ -22,8 +22,8 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragment;
import androidx.preference.PreferenceManager;
import com.android.internal.aospextended.hardware.LineageHardwareManager;
import com.android.internal.aospextended.hardware.TouchscreenGesture;
import lineageos.hardware.LineageHardwareManager;
import lineageos.hardware.TouchscreenGesture;
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;