Merge change 25734 into eclair

* changes:
  Show the live wallpaper on the lock screen.
This commit is contained in:
Android (Google) Code Review
2009-09-18 13:16:30 -04:00
8 changed files with 114 additions and 12 deletions

View File

@ -435,6 +435,12 @@ public interface WindowManagerPolicy {
*/
public int subWindowTypeToLayerLw(int type);
/**
* Get the highest layer (actually one more than) that the wallpaper is
* allowed to be in.
*/
public int getMaxWallpaperLayer();
/**
* Called when the system would like to show a UI to indicate that an
* application is starting. You can use this to add a

View File

@ -22,7 +22,7 @@
android:interpolator="@anim/decelerate_interpolator">
<scale android:fromXScale="0.9" android:toXScale="1.0"
android:fromYScale="0.9" android:toYScale="1.0"
android:pivotX="50%" android:pivotY="50%"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_shortAnimTime" />
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_shortAnimTime" />

View File

@ -21,7 +21,7 @@
android:interpolator="@anim/accelerate_interpolator">
<scale android:fromXScale="1.0" android:toXScale="0.9"
android:fromYScale="1.0" android:toYScale="0.9"
android:pivotX="50%" android:pivotY="50%"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_shortAnimTime" />
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
android:duration="@android:integer/config_shortAnimTime"/>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_interpolator">
<scale android:fromXScale="2.0" android:toXScale="1.0"
android:fromYScale="2.0" android:toYScale="1.0"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_interpolator"
android:zAdjustment="top">
<scale android:fromXScale="1.0" android:toXScale="2.0"
android:fromYScale="1.0" android:toYScale="2.0"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
<alpha android:fromAlpha="1.0" android:toAlpha="0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>

View File

@ -177,6 +177,13 @@
<item name="windowExitAnimation">@anim/wallpaper_exit</item>
</style>
<!-- A special animation we can use for recent applications,
for devices that can support it (do alpha transformations). -->
<style name="Animation.RecentApplications">
<item name="windowEnterAnimation">@anim/recent_enter</item>
<item name="windowExitAnimation">@anim/recent_exit</item>
</style>
<!-- Status Bar Styles -->
<style name="TextAppearance.StatusBarTitle">

View File

@ -500,4 +500,10 @@
<item name="windowContentOverlay">@null</item>
<item name="textAppearance">@style/TextAppearance.Theme.Dialog.AppError</item>
</style>
<!-- Special theme for the recent apps dialog, to allow customization
with overlays. -->
<style name="Theme.Dialog.RecentApplications">
</style>
</resources>

View File

@ -1384,12 +1384,18 @@ public class WindowManagerService extends IWindowManager.Stub
(mLowerWallpaperTarget == null && foundW.mAppToken != null)
? foundW.mAppToken.animLayerAdjustment : 0;
final int maxLayer = mPolicy.getMaxWallpaperLayer()
* TYPE_LAYER_MULTIPLIER
+ TYPE_LAYER_OFFSET;
// Now w is the window we are supposed to be behind... but we
// need to be sure to also be behind any of its attached windows,
// AND any starting window associated with it.
// AND any starting window associated with it, AND below the
// maximum layer the policy allows for wallpapers.
while (foundI > 0) {
WindowState wb = (WindowState)localmWindows.get(foundI-1);
if (wb.mAttachedWindow != foundW &&
if (wb.mBaseLayer < maxLayer &&
wb.mAttachedWindow != foundW &&
(wb.mAttrs.type != TYPE_APPLICATION_STARTING ||
wb.mToken != foundW.mToken)) {
// This window is not related to the previous one in any
@ -2266,6 +2272,12 @@ public class WindowManagerService extends IWindowManager.Stub
// Currently in a hide animation... turn this into
// an exit.
win.mExiting = true;
} else if (win == mWallpaperTarget) {
// If the wallpaper is currently behind this
// window, we need to change both of them inside
// of a transaction to avoid artifacts.
win.mExiting = true;
win.mAnimating = true;
} else {
if (mInputMethodWindow == win) {
mInputMethodWindow = null;
@ -3157,6 +3169,10 @@ public class WindowManagerService extends IWindowManager.Stub
com.android.internal.R.styleable.Window_windowIsTranslucent, false)) {
return;
}
if (ent.array.getBoolean(
com.android.internal.R.styleable.Window_windowIsFloating, false)) {
return;
}
if (ent.array.getBoolean(
com.android.internal.R.styleable.Window_windowShowWallpaper, false)) {
return;
@ -7087,8 +7103,8 @@ public class WindowManagerService extends IWindowManager.Stub
mAppToken.firstWindowDrawn = true;
if (mAppToken.startingData != null) {
if (DEBUG_STARTING_WINDOW) Log.v(TAG, "Finish starting "
+ mToken
if (DEBUG_STARTING_WINDOW || DEBUG_ANIM) Log.v(TAG,
"Finish starting " + mToken
+ ": first real window is shown, no animation");
// If this initial window is animating, stop it -- we
// will do an animation to reveal it from behind the
@ -7305,13 +7321,13 @@ public class WindowManagerService extends IWindowManager.Stub
// Compute the desired transformation.
tmpMatrix.setTranslate(frame.left, frame.top);
if (selfTransformation) {
tmpMatrix.preConcat(mTransformation.getMatrix());
tmpMatrix.postConcat(mTransformation.getMatrix());
}
if (attachedTransformation != null) {
tmpMatrix.preConcat(attachedTransformation.getMatrix());
tmpMatrix.postConcat(attachedTransformation.getMatrix());
}
if (appTransformation != null) {
tmpMatrix.preConcat(appTransformation.getMatrix());
tmpMatrix.postConcat(appTransformation.getMatrix());
}
// "convert" it into SurfaceFlinger's format
@ -8928,11 +8944,14 @@ public class WindowManagerService extends IWindowManager.Stub
wallpaperMayChange = true;
}
}
boolean wasAnimating = w.mAnimating;
if (w.stepAnimationLocked(currentTime, dw, dh)) {
animating = true;
//w.dump(" ");
}
if (wasAnimating && !w.mAnimating && mWallpaperTarget == w) {
wallpaperMayChange = true;
}
mPolicy.animatingWindowLw(w, attrs);
}
@ -9269,6 +9288,7 @@ public class WindowManagerService extends IWindowManager.Stub
boolean covered = false;
boolean syswin = false;
boolean backgroundFillerShown = false;
boolean forceHiding = false;
final int N = mWindows.size();
@ -9401,7 +9421,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
if (w.mAttachedHidden) {
if ((forceHiding
&& attrs.type != WindowManager.LayoutParams.TYPE_STATUS_BAR
&& attrs.type != WindowManager.LayoutParams.TYPE_WALLPAPER)
|| w.mAttachedHidden) {
if (!w.mLastHidden) {
//dump();
w.mLastHidden = true;
@ -9515,6 +9538,9 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (displayed) {
if (attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD) {
forceHiding = true;
}
if (!covered) {
if (attrs.width == LayoutParams.FILL_PARENT
&& attrs.height == LayoutParams.FILL_PARENT) {
@ -9597,7 +9623,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
backgroundFillerShown = true;
mBackgroundFillerShown = true;
} else if (canBeSeen && !obscured &&
} else if (canBeSeen && !obscured && !forceHiding &&
(attrFlags&FLAG_BLUR_BEHIND|FLAG_DIM_BEHIND) != 0) {
if (localLOGV) Log.v(TAG, "Win " + w
+ ": blurring=" + blurring