summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-02-18 08:14:01 -0800
committerJoe Onorato <joeo@android.com>2010-02-18 14:17:23 -0800
commit424c61fd0aedb4a6cc8f53f4e417dbf23bf7fb18 (patch)
tree62a0963123d55867a6c6a69f51c8c24acbc8cc86 /services
parentc34ebce475a6994f1aa59b8c535ff966c8f59431 (diff)
downloadframeworks_base-424c61fd0aedb4a6cc8f53f4e417dbf23bf7fb18.zip
frameworks_base-424c61fd0aedb4a6cc8f53f4e417dbf23bf7fb18.tar.gz
frameworks_base-424c61fd0aedb4a6cc8f53f4e417dbf23bf7fb18.tar.bz2
Fix 2363699 - Make notification shade animate closed when disabled
The animation was removed to fix 2298803 because if the windowshade was tracking when this happened, it would get stuck.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/status/StatusBarService.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/services/java/com/android/server/status/StatusBarService.java b/services/java/com/android/server/status/StatusBarService.java
index c7c3335..dab8b72 100644
--- a/services/java/com/android/server/status/StatusBarService.java
+++ b/services/java/com/android/server/status/StatusBarService.java
@@ -972,7 +972,7 @@ public class StatusBarService extends IStatusBar.Stub
return;
}
- prepareTracking(0);
+ prepareTracking(0, true);
performFling(0, 2000.0f, true);
}
@@ -980,7 +980,9 @@ public class StatusBarService extends IStatusBar.Stub
if (SPEW) {
Log.d(TAG, "animateCollapse(): mExpanded=" + mExpanded
+ " mExpandedVisible=" + mExpandedVisible
+ + " mExpanded=" + mExpanded
+ " mAnimating=" + mAnimating
+ + " mAnimY=" + mAnimY
+ " mAnimVel=" + mAnimVel);
}
@@ -988,12 +990,16 @@ public class StatusBarService extends IStatusBar.Stub
return;
}
+ int y;
if (mAnimating) {
- return;
+ y = (int)mAnimY;
+ } else {
+ y = mDisplay.getHeight()-1;
}
-
- int y = mDisplay.getHeight()-1;
- prepareTracking(y);
+ // Let the fling think that we're open so it goes in the right direction
+ // and doesn't try to re-open the windowshade.
+ mExpanded = true;
+ prepareTracking(y, false);
performFling(y, -2000.0f, true);
}
@@ -1108,10 +1114,9 @@ public class StatusBarService extends IStatusBar.Stub
}
}
- void prepareTracking(int y) {
+ void prepareTracking(int y, boolean opening) {
mTracking = true;
mVelocityTracker = VelocityTracker.obtain();
- boolean opening = !mExpanded;
if (opening) {
mAnimAccel = 2000.0f;
mAnimVel = 200;
@@ -1199,10 +1204,11 @@ public class StatusBarService extends IStatusBar.Stub
}
boolean interceptTouchEvent(MotionEvent event) {
- if (SPEW) Log.d(TAG, "Touch: rawY=" + event.getRawY() + " event=" + event);
+ if (SPEW) Log.d(TAG, "Touch: rawY=" + event.getRawY() + " event=" + event + " mDisabled="
+ + mDisabled);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
- return true;
+ return false;
}
final int statusBarSize = mStatusBarView.getHeight();
@@ -1218,7 +1224,7 @@ public class StatusBarService extends IStatusBar.Stub
}
if ((!mExpanded && y < hitSize) ||
(mExpanded && y > (mDisplay.getHeight()-hitSize))) {
- prepareTracking(y);
+ prepareTracking(y, !mExpanded); // opening if we're not already fully visible
mVelocityTracker.addMovement(event);
}
} else if (mTracking) {
@@ -1679,9 +1685,7 @@ public class StatusBarService extends IStatusBar.Stub
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((net & StatusBarManager.DISABLE_EXPAND) != 0) {
Log.d(TAG, "DISABLE_EXPAND: yes");
- mAnimating = false;
- updateExpandedViewPos(0);
- performCollapse();
+ animateCollapse();
}
}
if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {