Skip to content

Commit

Permalink
TouchGestures: Fix KeyHandler for opening messaging app
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
neobuddy89 authored and SKULSHADY committed Feb 19, 2020
1 parent 9f6a5af commit 6a7f523
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/com/android/touch/gestures/KeyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 6a7f523

Please sign in to comment.