From 6a7f5236ecdc86e57dbcdb763057e281a09f96d6 Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Sat, 8 Feb 2020 22:30:35 +0300 Subject: [PATCH] TouchGestures: Fix KeyHandler for opening messaging app This fixes touchscreen gesture assigned to messaging app. Before this fix it would open random app - System Tracer for me, Google Photos for someone else. Change-Id: I5675382c5bdeaaca304ca5bbec4c123fd0327674 Signed-off-by: Pranav Vashi --- src/com/android/touch/gestures/KeyHandler.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/com/android/touch/gestures/KeyHandler.java b/src/com/android/touch/gestures/KeyHandler.java index b9fbdb6..458862e 100644 --- a/src/com/android/touch/gestures/KeyHandler.java +++ b/src/com/android/touch/gestures/KeyHandler.java @@ -271,14 +271,10 @@ private void launchEmail() { private void launchMessages() { mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION); mPowerManager.wakeUp(SystemClock.uptimeMillis(), GESTURE_WAKEUP_REASON); - final String defaultApplication = Settings.Secure.getString( - mContext.getContentResolver(), "sms_default_application"); - final PackageManager pm = mContext.getPackageManager(); - final Intent intent = pm.getLaunchIntentForPackage(defaultApplication); - if (intent != null) { - startActivitySafely(intent); - doHapticFeedback(); - } + final Intent intent = getLaunchableIntent( + new Intent(Intent.ACTION_VIEW, Uri.parse("sms:"))); + startActivitySafely(intent); + doHapticFeedback(); } private void toggleFlashlight() {