From bfaf3b91709ef35e0d5901b186edd7c2a9729161 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 22 Feb 2011 15:00:50 -0800 Subject: Be more precise about tracking fallback keys. Only initiate fallback key handling if the first key down was not handled and there is no other fallback key already in progress. This prevents spurious fallbacks from being generated when applications handle the initial down but not repeated downs or the up. Change-Id: I8a513896cf96b16dc502cd72291926d5532aa2ab --- .../src/com/android/internal/policy/impl/PhoneWindowManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'policy') diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 156391e..14f4df1 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1448,7 +1448,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { | KeyEvent.META_META_LEFT_ON | KeyEvent.META_META_RIGHT_ON)); if (shortcutIntent != null) { shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - mContext.startActivity(shortcutIntent); + try { + mContext.startActivity(shortcutIntent); + } catch (ActivityNotFoundException ex) { + Slog.w(TAG, "Dropping shortcut key combination because " + + "the activity to which it is registered was not found: " + + "META+" + KeyEvent.keyCodeToString(keyCode), ex); + } return null; } } -- cgit v1.1