Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +15 −11 Original line number Original line Diff line number Diff line Loading @@ -116,7 +116,6 @@ import java.io.FileReader; import java.io.IOException; import java.io.IOException; import java.io.PrintWriter; import java.io.PrintWriter; import java.util.HashSet; import java.util.HashSet; import java.util.List; import static android.view.WindowManager.LayoutParams.*; import static android.view.WindowManager.LayoutParams.*; import static android.view.WindowManagerPolicy.WindowManagerFuncs.LID_ABSENT; import static android.view.WindowManagerPolicy.WindowManagerFuncs.LID_ABSENT; Loading Loading @@ -2300,20 +2299,25 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean goingToNotificationShade) { boolean goingToNotificationShade) { if (goingToNotificationShade) { if (goingToNotificationShade) { return AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_fade_in); return AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_fade_in); } } else if (onWallpaper) { Animation a = AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_wallpaper); AnimationSet set = (AnimationSet) a; AnimationSet set = (AnimationSet) AnimationUtils.loadAnimation(mContext, onWallpaper ? // TODO: Use XML interpolators when we have log interpolators available in XML. R.anim.lock_screen_behind_enter_wallpaper : set.getAnimations().get(0).setInterpolator(mLogDecelerateInterpolator); set.getAnimations().get(1).setInterpolator(mLogDecelerateInterpolator); return set; } else { Animation a = AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter); R.anim.lock_screen_behind_enter); AnimationSet set = (AnimationSet) a; // TODO: Use XML interpolators when we have log interpolators available in XML. // TODO: Use XML interpolators when we have log interpolators available in XML. final List<Animation> animations = set.getAnimations(); set.getAnimations().get(0).setInterpolator(mLogDecelerateInterpolator); for (int i = animations.size() - 1; i >= 0; --i) { animations.get(i).setInterpolator(mLogDecelerateInterpolator); } return set; return set; } } } @Override @Override Loading services/core/java/com/android/server/wm/WindowAnimator.java +60 −78 Original line number Original line Diff line number Diff line Loading @@ -91,9 +91,6 @@ public class WindowAnimator { boolean mKeyguardGoingAwayToNotificationShade; boolean mKeyguardGoingAwayToNotificationShade; boolean mKeyguardGoingAwayDisableWindowAnimations; boolean mKeyguardGoingAwayDisableWindowAnimations; /** Use one animation for all entering activities after keyguard is dismissed. */ Animation mPostKeyguardExitAnimation; // forceHiding states. // forceHiding states. static final int KEYGUARD_NOT_SHOWN = 0; static final int KEYGUARD_NOT_SHOWN = 0; static final int KEYGUARD_ANIMATING_IN = 1; static final int KEYGUARD_ANIMATING_IN = 1; Loading Loading @@ -223,6 +220,9 @@ public class WindowAnimator { ++mAnimTransactionSequence; ++mAnimTransactionSequence; final WindowList windows = mService.getWindowListLocked(displayId); final WindowList windows = mService.getWindowListLocked(displayId); ArrayList<WindowStateAnimator> unForceHiding = null; boolean wallpaperInUnForceHiding = false; WindowState wallpaper = null; if (mKeyguardGoingAway) { if (mKeyguardGoingAway) { for (int i = windows.size() - 1; i >= 0; i--) { for (int i = windows.size() - 1; i >= 0; i--) { Loading Loading @@ -261,9 +261,6 @@ public class WindowAnimator { final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ? final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ? null : winShowWhenLocked.mAppToken; null : winShowWhenLocked.mAppToken; boolean wallpaperInUnForceHiding = false; ArrayList<WindowStateAnimator> unForceHiding = null; WindowState wallpaper = null; for (int i = windows.size() - 1; i >= 0; i--) { for (int i = windows.size() - 1; i >= 0; i--) { WindowState win = windows.get(i); WindowState win = windows.get(i); WindowStateAnimator winAnimator = win.mWinAnimator; WindowStateAnimator winAnimator = win.mWinAnimator; Loading Loading @@ -330,45 +327,31 @@ public class WindowAnimator { } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { final boolean hideWhenLocked = !((win.mIsImWindow && showImeOverKeyguard) || final boolean hideWhenLocked = !((win.mIsImWindow && showImeOverKeyguard) || (appShowWhenLocked != null && appShowWhenLocked == win.mAppToken)); (appShowWhenLocked != null && appShowWhenLocked == win.mAppToken)); final boolean changed; if (((mForceHiding == KEYGUARD_ANIMATING_IN) if (((mForceHiding == KEYGUARD_ANIMATING_IN) && (!winAnimator.isAnimating() || hideWhenLocked)) && (!winAnimator.isAnimating() || hideWhenLocked)) || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) { || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) { if (!win.hideLw(false, false)) { changed = win.hideLw(false, false); // Was already hidden if ((DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) continue; && changed) Slog.v(TAG, "Now policy hidden: " + win); } if (DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, "Now policy hidden: " + win); } else { } else { if (!win.showLw(false, false)) { changed = win.showLw(false, false); // Was already showing. if ((DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) continue; && changed) Slog.v(TAG, "Now policy shown: " + win); } if (changed) { final boolean visibleNow = win.isVisibleNow(); if ((mBulkUpdateParams & SET_FORCE_HIDING_CHANGED) != 0 if (!visibleNow) { && win.isVisibleNow() /*w.isReadyForDisplay()*/) { // Couldn't really show, must showLw() again when win becomes visible. win.hideLw(false, false); continue; } if (DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, "Now policy shown: " + win); if ((mBulkUpdateParams & SET_FORCE_HIDING_CHANGED) != 0) { if (unForceHiding == null) { if (unForceHiding == null) { unForceHiding = new ArrayList<>(); unForceHiding = new ArrayList<WindowStateAnimator>(); } } unForceHiding.add(winAnimator); unForceHiding.add(winAnimator); if ((flags & FLAG_SHOW_WALLPAPER) != 0) { if ((flags & FLAG_SHOW_WALLPAPER) != 0) { wallpaperInUnForceHiding = true; wallpaperInUnForceHiding = true; } } } else if (mPostKeyguardExitAnimation != null) { // We're already in the middle of an animation. Use the existing // animation to bring in this window. winAnimator.setAnimation(mPostKeyguardExitAnimation); winAnimator.keyguardGoingAwayAnimation = true; } } final WindowState currentFocus = mService.mCurrentFocus; final WindowState currentFocus = mService.mCurrentFocus; if (currentFocus == null || currentFocus.mLayer < win.mLayer) { if (currentFocus == null || currentFocus.mLayer < win.mLayer) { // We are showing on top of the current // We are showing on to of the current // focus, so re-evaluate focus to make // focus, so re-evaluate focus to make // sure it is correct. // sure it is correct. if (WindowManagerService.DEBUG_FOCUS_LIGHT) Slog.v(TAG, if (WindowManagerService.DEBUG_FOCUS_LIGHT) Slog.v(TAG, Loading @@ -376,7 +359,8 @@ public class WindowAnimator { mService.mFocusMayChange = true; mService.mFocusMayChange = true; } } } } if ((flags & FLAG_SHOW_WALLPAPER) != 0) { } if (changed && (flags & FLAG_SHOW_WALLPAPER) != 0) { mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; setPendingLayoutChanges(Display.DEFAULT_DISPLAY, setPendingLayoutChanges(Display.DEFAULT_DISPLAY, WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER); WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER); Loading Loading @@ -419,33 +403,29 @@ public class WindowAnimator { // If we have windows that are being show due to them no longer // If we have windows that are being show due to them no longer // being force-hidden, apply the appropriate animation to them. // being force-hidden, apply the appropriate animation to them. if (unForceHiding != null) { if (unForceHiding != null) { // This only happens the first time that we detect the keyguard is animating out. boolean startKeyguardExit = true; if (mKeyguardGoingAwayDisableWindowAnimations) { for (int i=unForceHiding.size()-1; i>=0; i--) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: skipping anim for windows"); Animation a = null; if (!mKeyguardGoingAwayDisableWindowAnimations) { a = mPolicy.createForceHideEnterAnimation(wallpaperInUnForceHiding, mKeyguardGoingAwayToNotificationShade); if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim=" + a + " for win=" + unForceHiding.get(i)); } else { } else { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim for windows"); if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: skipping anim for win=" mPostKeyguardExitAnimation = mPolicy.createForceHideEnterAnimation( + unForceHiding.get(i)); wallpaperInUnForceHiding, mKeyguardGoingAwayToNotificationShade); } } if (mPostKeyguardExitAnimation != null) { if (a != null) { for (int i=unForceHiding.size()-1; i>=0; i--) { final WindowStateAnimator winAnimator = unForceHiding.get(i); final WindowStateAnimator winAnimator = unForceHiding.get(i); winAnimator.setAnimation(mPostKeyguardExitAnimation); winAnimator.setAnimation(a); winAnimator.keyguardGoingAwayAnimation = true; winAnimator.keyguardGoingAwayAnimation = true; } if (startKeyguardExit && mKeyguardGoingAway) { } // Do one time only. } mPolicy.startKeyguardExitAnimation(mCurrentTime + a.getStartOffset(), a.getDuration()); if (mPostKeyguardExitAnimation != null) { // We're in the midst of a keyguard exit animation. if (mKeyguardGoingAway) { mPolicy.startKeyguardExitAnimation(mCurrentTime + mPostKeyguardExitAnimation.getStartOffset(), mPostKeyguardExitAnimation.getDuration()); mKeyguardGoingAway = false; mKeyguardGoingAway = false; } else if (mPostKeyguardExitAnimation.hasEnded()) { startKeyguardExit = false; // Done with the animation, reset. } mPostKeyguardExitAnimation = null; } } } } Loading @@ -456,7 +436,9 @@ public class WindowAnimator { Animation a = mPolicy.createForceHideWallpaperExitAnimation( Animation a = mPolicy.createForceHideWallpaperExitAnimation( mKeyguardGoingAwayToNotificationShade); mKeyguardGoingAwayToNotificationShade); if (a != null) { if (a != null) { wallpaper.mWinAnimator.setAnimation(a); WindowStateAnimator animator = wallpaper.mWinAnimator; animator.setAnimation(a); } } } } } } } Loading Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +15 −11 Original line number Original line Diff line number Diff line Loading @@ -116,7 +116,6 @@ import java.io.FileReader; import java.io.IOException; import java.io.IOException; import java.io.PrintWriter; import java.io.PrintWriter; import java.util.HashSet; import java.util.HashSet; import java.util.List; import static android.view.WindowManager.LayoutParams.*; import static android.view.WindowManager.LayoutParams.*; import static android.view.WindowManagerPolicy.WindowManagerFuncs.LID_ABSENT; import static android.view.WindowManagerPolicy.WindowManagerFuncs.LID_ABSENT; Loading Loading @@ -2300,20 +2299,25 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean goingToNotificationShade) { boolean goingToNotificationShade) { if (goingToNotificationShade) { if (goingToNotificationShade) { return AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_fade_in); return AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_fade_in); } } else if (onWallpaper) { Animation a = AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_wallpaper); AnimationSet set = (AnimationSet) a; AnimationSet set = (AnimationSet) AnimationUtils.loadAnimation(mContext, onWallpaper ? // TODO: Use XML interpolators when we have log interpolators available in XML. R.anim.lock_screen_behind_enter_wallpaper : set.getAnimations().get(0).setInterpolator(mLogDecelerateInterpolator); set.getAnimations().get(1).setInterpolator(mLogDecelerateInterpolator); return set; } else { Animation a = AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter); R.anim.lock_screen_behind_enter); AnimationSet set = (AnimationSet) a; // TODO: Use XML interpolators when we have log interpolators available in XML. // TODO: Use XML interpolators when we have log interpolators available in XML. final List<Animation> animations = set.getAnimations(); set.getAnimations().get(0).setInterpolator(mLogDecelerateInterpolator); for (int i = animations.size() - 1; i >= 0; --i) { animations.get(i).setInterpolator(mLogDecelerateInterpolator); } return set; return set; } } } @Override @Override Loading
services/core/java/com/android/server/wm/WindowAnimator.java +60 −78 Original line number Original line Diff line number Diff line Loading @@ -91,9 +91,6 @@ public class WindowAnimator { boolean mKeyguardGoingAwayToNotificationShade; boolean mKeyguardGoingAwayToNotificationShade; boolean mKeyguardGoingAwayDisableWindowAnimations; boolean mKeyguardGoingAwayDisableWindowAnimations; /** Use one animation for all entering activities after keyguard is dismissed. */ Animation mPostKeyguardExitAnimation; // forceHiding states. // forceHiding states. static final int KEYGUARD_NOT_SHOWN = 0; static final int KEYGUARD_NOT_SHOWN = 0; static final int KEYGUARD_ANIMATING_IN = 1; static final int KEYGUARD_ANIMATING_IN = 1; Loading Loading @@ -223,6 +220,9 @@ public class WindowAnimator { ++mAnimTransactionSequence; ++mAnimTransactionSequence; final WindowList windows = mService.getWindowListLocked(displayId); final WindowList windows = mService.getWindowListLocked(displayId); ArrayList<WindowStateAnimator> unForceHiding = null; boolean wallpaperInUnForceHiding = false; WindowState wallpaper = null; if (mKeyguardGoingAway) { if (mKeyguardGoingAway) { for (int i = windows.size() - 1; i >= 0; i--) { for (int i = windows.size() - 1; i >= 0; i--) { Loading Loading @@ -261,9 +261,6 @@ public class WindowAnimator { final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ? final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ? null : winShowWhenLocked.mAppToken; null : winShowWhenLocked.mAppToken; boolean wallpaperInUnForceHiding = false; ArrayList<WindowStateAnimator> unForceHiding = null; WindowState wallpaper = null; for (int i = windows.size() - 1; i >= 0; i--) { for (int i = windows.size() - 1; i >= 0; i--) { WindowState win = windows.get(i); WindowState win = windows.get(i); WindowStateAnimator winAnimator = win.mWinAnimator; WindowStateAnimator winAnimator = win.mWinAnimator; Loading Loading @@ -330,45 +327,31 @@ public class WindowAnimator { } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { final boolean hideWhenLocked = !((win.mIsImWindow && showImeOverKeyguard) || final boolean hideWhenLocked = !((win.mIsImWindow && showImeOverKeyguard) || (appShowWhenLocked != null && appShowWhenLocked == win.mAppToken)); (appShowWhenLocked != null && appShowWhenLocked == win.mAppToken)); final boolean changed; if (((mForceHiding == KEYGUARD_ANIMATING_IN) if (((mForceHiding == KEYGUARD_ANIMATING_IN) && (!winAnimator.isAnimating() || hideWhenLocked)) && (!winAnimator.isAnimating() || hideWhenLocked)) || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) { || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) { if (!win.hideLw(false, false)) { changed = win.hideLw(false, false); // Was already hidden if ((DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) continue; && changed) Slog.v(TAG, "Now policy hidden: " + win); } if (DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, "Now policy hidden: " + win); } else { } else { if (!win.showLw(false, false)) { changed = win.showLw(false, false); // Was already showing. if ((DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) continue; && changed) Slog.v(TAG, "Now policy shown: " + win); } if (changed) { final boolean visibleNow = win.isVisibleNow(); if ((mBulkUpdateParams & SET_FORCE_HIDING_CHANGED) != 0 if (!visibleNow) { && win.isVisibleNow() /*w.isReadyForDisplay()*/) { // Couldn't really show, must showLw() again when win becomes visible. win.hideLw(false, false); continue; } if (DEBUG_KEYGUARD || WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, "Now policy shown: " + win); if ((mBulkUpdateParams & SET_FORCE_HIDING_CHANGED) != 0) { if (unForceHiding == null) { if (unForceHiding == null) { unForceHiding = new ArrayList<>(); unForceHiding = new ArrayList<WindowStateAnimator>(); } } unForceHiding.add(winAnimator); unForceHiding.add(winAnimator); if ((flags & FLAG_SHOW_WALLPAPER) != 0) { if ((flags & FLAG_SHOW_WALLPAPER) != 0) { wallpaperInUnForceHiding = true; wallpaperInUnForceHiding = true; } } } else if (mPostKeyguardExitAnimation != null) { // We're already in the middle of an animation. Use the existing // animation to bring in this window. winAnimator.setAnimation(mPostKeyguardExitAnimation); winAnimator.keyguardGoingAwayAnimation = true; } } final WindowState currentFocus = mService.mCurrentFocus; final WindowState currentFocus = mService.mCurrentFocus; if (currentFocus == null || currentFocus.mLayer < win.mLayer) { if (currentFocus == null || currentFocus.mLayer < win.mLayer) { // We are showing on top of the current // We are showing on to of the current // focus, so re-evaluate focus to make // focus, so re-evaluate focus to make // sure it is correct. // sure it is correct. if (WindowManagerService.DEBUG_FOCUS_LIGHT) Slog.v(TAG, if (WindowManagerService.DEBUG_FOCUS_LIGHT) Slog.v(TAG, Loading @@ -376,7 +359,8 @@ public class WindowAnimator { mService.mFocusMayChange = true; mService.mFocusMayChange = true; } } } } if ((flags & FLAG_SHOW_WALLPAPER) != 0) { } if (changed && (flags & FLAG_SHOW_WALLPAPER) != 0) { mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; setPendingLayoutChanges(Display.DEFAULT_DISPLAY, setPendingLayoutChanges(Display.DEFAULT_DISPLAY, WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER); WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER); Loading Loading @@ -419,33 +403,29 @@ public class WindowAnimator { // If we have windows that are being show due to them no longer // If we have windows that are being show due to them no longer // being force-hidden, apply the appropriate animation to them. // being force-hidden, apply the appropriate animation to them. if (unForceHiding != null) { if (unForceHiding != null) { // This only happens the first time that we detect the keyguard is animating out. boolean startKeyguardExit = true; if (mKeyguardGoingAwayDisableWindowAnimations) { for (int i=unForceHiding.size()-1; i>=0; i--) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: skipping anim for windows"); Animation a = null; if (!mKeyguardGoingAwayDisableWindowAnimations) { a = mPolicy.createForceHideEnterAnimation(wallpaperInUnForceHiding, mKeyguardGoingAwayToNotificationShade); if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim=" + a + " for win=" + unForceHiding.get(i)); } else { } else { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim for windows"); if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: skipping anim for win=" mPostKeyguardExitAnimation = mPolicy.createForceHideEnterAnimation( + unForceHiding.get(i)); wallpaperInUnForceHiding, mKeyguardGoingAwayToNotificationShade); } } if (mPostKeyguardExitAnimation != null) { if (a != null) { for (int i=unForceHiding.size()-1; i>=0; i--) { final WindowStateAnimator winAnimator = unForceHiding.get(i); final WindowStateAnimator winAnimator = unForceHiding.get(i); winAnimator.setAnimation(mPostKeyguardExitAnimation); winAnimator.setAnimation(a); winAnimator.keyguardGoingAwayAnimation = true; winAnimator.keyguardGoingAwayAnimation = true; } if (startKeyguardExit && mKeyguardGoingAway) { } // Do one time only. } mPolicy.startKeyguardExitAnimation(mCurrentTime + a.getStartOffset(), a.getDuration()); if (mPostKeyguardExitAnimation != null) { // We're in the midst of a keyguard exit animation. if (mKeyguardGoingAway) { mPolicy.startKeyguardExitAnimation(mCurrentTime + mPostKeyguardExitAnimation.getStartOffset(), mPostKeyguardExitAnimation.getDuration()); mKeyguardGoingAway = false; mKeyguardGoingAway = false; } else if (mPostKeyguardExitAnimation.hasEnded()) { startKeyguardExit = false; // Done with the animation, reset. } mPostKeyguardExitAnimation = null; } } } } Loading @@ -456,7 +436,9 @@ public class WindowAnimator { Animation a = mPolicy.createForceHideWallpaperExitAnimation( Animation a = mPolicy.createForceHideWallpaperExitAnimation( mKeyguardGoingAwayToNotificationShade); mKeyguardGoingAwayToNotificationShade); if (a != null) { if (a != null) { wallpaper.mWinAnimator.setAnimation(a); WindowStateAnimator animator = wallpaper.mWinAnimator; animator.setAnimation(a); } } } } } } } Loading