am cb1e32ac: am 44d51545: am 7d5c68e3: am 84b4791a: Merge "Modified lollipop Easter egg for TV compatibility" into lmp-dev

* commit 'cb1e32ac2b5eb12ff89af5eb8074908b5f54d047':
  Modified lollipop Easter egg for TV compatibility
diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java
index f92fd55..80bc5fe 100644
--- a/core/java/com/android/internal/app/PlatLogoActivity.java
+++ b/core/java/com/android/internal/app/PlatLogoActivity.java
@@ -36,6 +36,7 @@
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.Gravity;
+import android.view.KeyEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewOutlineProvider;
@@ -54,6 +55,7 @@
     };
     FrameLayout mLayout;
     int mTapCount;
+    int mKeyCount;
     PathInterpolator mInterpolator = new PathInterpolator(0f, 0f, 0.5f, 1f);
 
     static int newColorIndex() {
@@ -203,6 +205,28 @@
             }
         });
 
+        // Enable hardware keyboard input for TV compatibility.
+        im.setFocusable(true);
+        im.requestFocus();
+        im.setOnKeyListener(new View.OnKeyListener() {
+            @Override
+            public boolean onKey(View v, int keyCode, KeyEvent event) {
+                if (keyCode != KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
+                    ++mKeyCount;
+                    if (mKeyCount > 2) {
+                        if (mTapCount > 5) {
+                            im.performLongClick();
+                        } else {
+                            im.performClick();
+                        }
+                    }
+                    return true;
+                } else {
+                    return false;
+                }
+            }
+        });
+
         mLayout.addView(im, new FrameLayout.LayoutParams(size, size, Gravity.CENTER));
 
         im.animate().scaleX(0.3f).scaleY(0.3f)