summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-01-17 17:54:31 -0800
committerDianne Hackborn <hackbod@google.com>2011-01-18 11:08:40 -0800
commit08121bca5bb875707974853b57820804a9e7cd3a (patch)
treeb4f7c1431bc921a849ff3260d7e5743228690e01
parent60610d245f899c8c48ba6c7e94c0a20010fc6eed (diff)
downloadframeworks_base-08121bca5bb875707974853b57820804a9e7cd3a.zip
frameworks_base-08121bca5bb875707974853b57820804a9e7cd3a.tar.gz
frameworks_base-08121bca5bb875707974853b57820804a9e7cd3a.tar.bz2
Fix issue #3362666 Activities launched from ongoing notifications don't animate
The phone-oriented code for turning off animations when the screen is entirely covered by the status bar was not appropriate for the tablet. Change-Id: Ica3e0db989f16b9187eacd6ecf4ac3d17661dd6d
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java38
-rw-r--r--services/java/com/android/server/WindowManagerService.java19
2 files changed, 35 insertions, 22 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 6b559cf..747242f 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1965,23 +1965,29 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// behind it.
return false;
}
- if (mStatusBar != null && mStatusBar.isVisibleLw()) {
- Rect rect = new Rect(mStatusBar.getShownFrameLw());
- for (int i=mStatusBarPanels.size()-1; i>=0; i--) {
- WindowState w = mStatusBarPanels.get(i);
- if (w.isVisibleLw()) {
- rect.union(w.getShownFrameLw());
+ if (false) {
+ // Don't do this on the tablet, since the system bar never completely
+ // covers the screen, and with all its transparency this will
+ // incorrectly think it does cover it when it doesn't. We'll revisit
+ // this later when we re-do the phone status bar.
+ if (mStatusBar != null && mStatusBar.isVisibleLw()) {
+ Rect rect = new Rect(mStatusBar.getShownFrameLw());
+ for (int i=mStatusBarPanels.size()-1; i>=0; i--) {
+ WindowState w = mStatusBarPanels.get(i);
+ if (w.isVisibleLw()) {
+ rect.union(w.getShownFrameLw());
+ }
+ }
+ final int insetw = mRestrictedScreenWidth/10;
+ final int inseth = mRestrictedScreenHeight/10;
+ if (rect.contains(insetw, inseth, mRestrictedScreenWidth-insetw,
+ mRestrictedScreenHeight-inseth)) {
+ // All of the status bar windows put together cover the
+ // screen, so the app can't be seen. (Note this test doesn't
+ // work if the rects of these windows are at off offsets or
+ // sizes, causing gaps in the rect union we have computed.)
+ return false;
}
- }
- final int insetw = mRestrictedScreenWidth/10;
- final int inseth = mRestrictedScreenHeight/10;
- if (rect.contains(insetw, inseth, mRestrictedScreenWidth-insetw,
- mRestrictedScreenHeight-inseth)) {
- // All of the status bar windows put together cover the
- // screen, so the app can't be seen. (Note this test doesn't
- // work if the rects of these windows are at off offsets or
- // sizes, causing gaps in the rect union we have computed.)
- return false;
}
}
return true;
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 1b3725c..3e930ae 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -3031,7 +3031,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
private AttributeCache.Entry getCachedAnimations(WindowManager.LayoutParams lp) {
- if (DEBUG_ANIM) Slog.v(TAG, "Loading animations: params package="
+ if (DEBUG_ANIM) Slog.v(TAG, "Loading animations: layout params pkg="
+ (lp != null ? lp.packageName : null)
+ " resId=0x" + (lp != null ? Integer.toHexString(lp.windowAnimations) : null));
if (lp != null && lp.windowAnimations != 0) {
@@ -3052,7 +3052,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
private AttributeCache.Entry getCachedAnimations(String packageName, int resId) {
- if (DEBUG_ANIM) Slog.v(TAG, "Loading animations: params package="
+ if (DEBUG_ANIM) Slog.v(TAG, "Loading animations: package="
+ packageName + " resId=0x" + Integer.toHexString(resId));
if (packageName != null) {
if ((resId&0xFF000000) == 0x01000000) {
@@ -9957,8 +9957,8 @@ public class WindowManagerService extends IWindowManager.Stub
// The top-most window will supply the layout params,
// and we will determine it below.
LayoutParams animLp = null;
- AppWindowToken animToken = null;
int bestAnimLayer = -1;
+ boolean fullscreenAnim = false;
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
"New wallpaper target=" + mWallpaperTarget
@@ -10000,11 +10000,18 @@ public class WindowManagerService extends IWindowManager.Stub
// window, we will always use its anim.
if ((ws.mAttrs.flags&FLAG_COMPATIBLE_WINDOW) != 0) {
animLp = ws.mAttrs;
- animToken = ws.mAppToken;
bestAnimLayer = Integer.MAX_VALUE;
- } else if (ws.mLayer > bestAnimLayer) {
+ } else if (!fullscreenAnim || ws.mLayer > bestAnimLayer) {
+ animLp = ws.mAttrs;
+ bestAnimLayer = ws.mLayer;
+ }
+ fullscreenAnim = true;
+ }
+ } else if (!fullscreenAnim) {
+ WindowState ws = wtoken.findMainWindow();
+ if (ws != null) {
+ if (ws.mLayer > bestAnimLayer) {
animLp = ws.mAttrs;
- animToken = ws.mAppToken;
bestAnimLayer = ws.mLayer;
}
}