Fixing an issue where qsb press states could be out of sync. (Bug 5627327)

- Adding haptic feedback to qsb button clicks (Bug 5652304)

Change-Id: I93d7c7a737f167d7ddf2b426d87e3a062feccac3
diff --git a/src/com/android/launcher2/HolographicViewHelper.java b/src/com/android/launcher2/HolographicViewHelper.java
index 11e81b4..fd49908 100644
--- a/src/com/android/launcher2/HolographicViewHelper.java
+++ b/src/com/android/launcher2/HolographicViewHelper.java
@@ -42,7 +42,7 @@
     void generatePressedFocusedStates(ImageView v) {
         if (!mStatesUpdated && v != null) {
             mStatesUpdated = true;
-            Bitmap outline = createGlowingOutline(v, mTempCanvas);
+            Bitmap outline = createPressImage(v, mTempCanvas);
             FastBitmapDrawable d = new FastBitmapDrawable(outline);
 
             StateListDrawable states = new StateListDrawable();
@@ -54,10 +54,20 @@
     }
 
     /**
-     * Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location.
+     * Invalidates the pressed/focused states.
+     */
+    void invalidatePressedFocusedStates(ImageView v) {
+        mStatesUpdated = false;
+        if (v != null) {
+            v.invalidate();
+        }
+    }
+
+    /**
+     * Creates a new press state image which is the old image with a blue overlay.
      * Responsibility for the bitmap is transferred to the caller.
      */
-    private Bitmap createGlowingOutline(ImageView v, Canvas canvas) {
+    private Bitmap createPressImage(ImageView v, Canvas canvas) {
         final int padding = HolographicOutlineHelper.MAX_OUTER_BLUR_RADIUS;
         final Bitmap b = Bitmap.createBitmap(
                 v.getWidth() + padding, v.getHeight() + padding, Bitmap.Config.ARGB_8888);