Pulse: Fix FC and improve performance [1/2]

Centralize detach/attach calls into Pulse Controller,
so we have a well known operations chain without dealing with different
views that could change pulse state even asyncronously.

Also fix albumart glitches when unlocking, detaching lockscreen pulse
view as soon as keyguard prepares to fade out.

Also don't add more opacity to lockscreen when showing pulse with solid
render,
that was giving a less smooth feeling during transitions.

Don't use the handler to link/unlink pulse, we already use offload thread
to start pulsing, and when unlinking we must be as fast as possible.

With the changes above, also this FC should be fixed.

Change-Id: Ib962242bddbef783882f359482a887017ea19239

--------- beginning of crash
08-06 12:40:59.783  2415  2415 E AndroidRuntime: FATAL EXCEPTION: main
08-06 12:40:59.783  2415  2415 E AndroidRuntime: Process: com.android.systemui, PID: 2415
08-06 12:40:59.783  2415  2415 E AndroidRuntime: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at android.view.ViewGroup.addViewInner(ViewGroup.java:5150)
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at android.view.ViewGroup.addView(ViewGroup.java:4979)
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at android.view.ViewGroup.addView(ViewGroup.java:4919)
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at android.view.ViewGroup.addView(ViewGroup.java:4892)
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at com.android.systemui.navigation.pulse.PulseControllerImpl.attachPulseTo(PulseControllerImpl.java:218)
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at com.android.systemui.statusbar.phone.NavigationBarFrame.updatePulseVisibility(NavigationBarFrame.java:112)
08-06 12:40:59.783  2415  2415 E AndroidRuntime:   at com.android.systemui.statusbar.phone.NavigationBarFrame.onKeyguardShowingChanged(NavigationBarFrame.java:107)

Change-Id: Ib1fc86033745d5f921d8145e49057def08134364
4 files changed
tree: 317409d180a9d3fe1451cd22b3a85e395b4d3a95
  1. res/
  2. src/
  3. Android.mk
  4. LICENSE