From a9599365a4a2aafdc8177a4101877e5615e25333 Mon Sep 17 00:00:00 2001 From: Arthur Hung Date: Mon, 30 Aug 2021 11:29:41 +0000 Subject: [PATCH] Remove warning-level trace The exception trace would be shown if the package is disabled or it didn't install in the device. Remove the trace for such expected behaviors while loading shortcut keys. Bug: 197888001 Test: manual Change-Id: Ie276469b67ecca47952b874d1cc3701c88bd1267 --- .../server/policy/ModifierShortcutManager.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/policy/ModifierShortcutManager.java b/services/core/java/com/android/server/policy/ModifierShortcutManager.java index a0771c0cc8d5a..e857d32c34491 100644 --- a/services/core/java/com/android/server/policy/ModifierShortcutManager.java +++ b/services/core/java/com/android/server/policy/ModifierShortcutManager.java @@ -48,7 +48,7 @@ import java.io.IOException; *
  • Returning particular kind of application intent by special key. */ class ModifierShortcutManager { - private static final String TAG = "ShortcutManager"; + private static final String TAG = "WindowManager"; private static final String TAG_BOOKMARKS = "bookmarks"; private static final String TAG_BOOKMARK = "bookmark"; @@ -188,7 +188,7 @@ class ModifierShortcutManager { | PackageManager.MATCH_UNINSTALLED_PACKAGES); } catch (PackageManager.NameNotFoundException e1) { Log.w(TAG, "Unable to add bookmark: " + packageName - + "/" + className, e); + + "/" + className + " not found."); continue; } } @@ -213,10 +213,8 @@ class ModifierShortcutManager { mIntentShortcuts.put(shortcutChar, shortcut); } } - } catch (XmlPullParserException e) { - Log.w(TAG, "Got exception parsing bookmarks.", e); - } catch (IOException e) { - Log.w(TAG, "Got exception parsing bookmarks.", e); + } catch (XmlPullParserException | IOException e) { + Log.e(TAG, "Got exception parsing bookmarks.", e); } } @@ -302,7 +300,7 @@ class ModifierShortcutManager { Slog.w(TAG, "Dropping application launch key because " + "the activity to which it is registered was not found: " + "keyCode=" + KeyEvent.keyCodeToString(keyCode) + "," - + " category=" + category, ex); + + " category=" + category); } return true; } else { @@ -318,7 +316,7 @@ class ModifierShortcutManager { } catch (ActivityNotFoundException ex) { Slog.w(TAG, "Dropping shortcut key combination because " + "the activity to which it is registered was not found: " - + "META+ or SEARCH" + KeyEvent.keyCodeToString(keyCode), ex); + + "META+ or SEARCH" + KeyEvent.keyCodeToString(keyCode)); } return true; }