Only translate prefixed strings to keys / axes.

In order to maintain compatibility, we need to only translate strings
prefixed with KEYCODE_ or AXIS_ into the appropriate key codes /
axes. Otherwise things like `adb shell input` will convert 4 into
KEYCODE_4 whereas before it would convert it into KEYCODE_BACK.

Bug: 14807833
Change-Id: I2cb41aa55dbb2e3fd62664c1b944877290d7e4be
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 2d1016a..852fce5 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -2698,10 +2698,10 @@
     public static int keyCodeFromString(String symbolicName) {
         if (symbolicName.startsWith(LABEL_PREFIX)) {
             symbolicName = symbolicName.substring(LABEL_PREFIX.length());
-        }
-        int keyCode = nativeKeyCodeFromString(symbolicName);
-        if (keyCode > 0) {
-            return keyCode;
+            int keyCode = nativeKeyCodeFromString(symbolicName);
+            if (keyCode > 0) {
+                return keyCode;
+            }
         }
         try {
             return Integer.parseInt(symbolicName, 10);