summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2012-11-07 17:32:30 -0800
committerJim Miller <jaggies@google.com>2012-11-07 18:10:49 -0800
commit8bbafed48b9c39e3ff5683b7151541c21b3e8ffe (patch)
tree064d85c7390f5906b057a15173da1e56ccd27265 /policy
parentc717d110ae5c2531a75420386f99ad8957732dbf (diff)
downloadframeworks_base-8bbafed48b9c39e3ff5683b7151541c21b3e8ffe.zip
frameworks_base-8bbafed48b9c39e3ff5683b7151541c21b3e8ffe.tar.gz
frameworks_base-8bbafed48b9c39e3ff5683b7151541c21b3e8ffe.tar.bz2
Don't handle click events on the emergency button in bouncer mode
This fixes a bug where the emergency call button was hidden, but not gone. This adds a call to setVisibility(INVISIBLE) when the alpha is animated to 0 and restore it when bouncer mode is dismissed. Fixes bug 7498389 Change-Id: I0898542ff7c666c8f41175a330b72d3450475739
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java
index 294bc3d..3d59f8d 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java
@@ -17,6 +17,7 @@
package com.android.internal.policy.impl.keyguard;
import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.graphics.drawable.Drawable;
import android.view.View;
@@ -27,7 +28,7 @@ import android.view.View;
public class KeyguardSecurityViewHelper {
public static void showBouncer(SecurityMessageDisplay securityMessageDisplay,
- View ecaView, Drawable bouncerFrame, int duration) {
+ final View ecaView, Drawable bouncerFrame, int duration) {
if (securityMessageDisplay != null) {
securityMessageDisplay.showBouncer(duration);
}
@@ -35,9 +36,23 @@ public class KeyguardSecurityViewHelper {
if (duration > 0) {
Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 0f);
anim.setDuration(duration);
+ anim.addListener(new AnimatorListenerAdapter() {
+ private boolean mCanceled;
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ // Fail safe and show the emergency button in onAnimationEnd()
+ mCanceled = true;
+ ecaView.setAlpha(1f);
+ }
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ ecaView.setVisibility(mCanceled ? View.VISIBLE : View.INVISIBLE);
+ }
+ });
anim.start();
} else {
ecaView.setAlpha(0f);
+ ecaView.setVisibility(View.INVISIBLE);
}
}
if (bouncerFrame != null) {
@@ -57,6 +72,7 @@ public class KeyguardSecurityViewHelper {
securityMessageDisplay.hideBouncer(duration);
}
if (ecaView != null) {
+ ecaView.setVisibility(View.VISIBLE);
if (duration > 0) {
Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 1f);
anim.setDuration(duration);