diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-21 20:34:30 -0400 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-21 20:34:30 -0400 |
commit | 7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce (patch) | |
tree | e061381f6d874d3f5e40c0e89812822e51f50384 | |
parent | 9197081f8feca110455740874e06e05771f462c8 (diff) | |
parent | bfe319e06aa56c081d0d94d64a8181291d7f7388 (diff) | |
download | frameworks_base-7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce.zip frameworks_base-7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce.tar.gz frameworks_base-7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce.tar.bz2 |
Merge change 26130 into eclair
* changes:
Turn animations on by default.
27 files changed, 291 insertions, 82 deletions
diff --git a/api/current.xml b/api/current.xml index 077b6ec..15bc2fa 100644 --- a/api/current.xml +++ b/api/current.xml @@ -36741,6 +36741,17 @@ visibility="public" > </field> +<field name="FLAG_ACTIVITY_NO_ANIMATION" + type="int" + transient="false" + volatile="false" + value="65536" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="FLAG_ACTIVITY_NO_HISTORY" type="int" transient="false" @@ -134820,6 +134831,21 @@ <parameter name="addr" type="int"> </parameter> </method> +<method name="formatShortFileSize" + return="java.lang.String" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="context" type="android.content.Context"> +</parameter> +<parameter name="number" type="long"> +</parameter> +</method> </class> <class name="Time" extends="java.lang.Object" diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index a86fe90..4561899 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -790,8 +790,8 @@ public class Activity extends ContextThemeWrapper * @see #onPostCreate */ protected void onCreate(Bundle savedInstanceState) { - mVisibleFromClient = mWindow.getWindowStyle().getBoolean( - com.android.internal.R.styleable.Window_windowNoDisplay, true); + mVisibleFromClient = !mWindow.getWindowStyle().getBoolean( + com.android.internal.R.styleable.Window_windowNoDisplay, false); mCalled = true; } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 7366b8b..f6ca50d 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2318,6 +2318,18 @@ public class Intent implements Parcelable { */ public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 0X00020000; /** + * If set in an Intent passed to {@link Context#startActivity Context.startActivity()}, + * this flag will prevent the system from applying an activity transition + * animation to go to the next activity state. This doesn't mean an + * animation will never run -- if another activity change happens that doesn't + * specify this flag before the activity started here is displayed, then + * that transition will be used. This this flag can be put to good use + * when you are going to do a series of activity operations but the + * animation seen by the user shouldn't be driven by the first activity + * change but rather a later one. + */ + public static final int FLAG_ACTIVITY_NO_ANIMATION = 0X00010000; + /** * If set, when sending a broadcast only registered receivers will be * called -- no BroadcastReceiver components will be launched. */ diff --git a/core/java/android/text/format/Formatter.java b/core/java/android/text/format/Formatter.java index 367b26c..baaa3ce 100644 --- a/core/java/android/text/format/Formatter.java +++ b/core/java/android/text/format/Formatter.java @@ -32,6 +32,18 @@ public final class Formatter { * @return formated string with the number */ public static String formatFileSize(Context context, long number) { + return formatFileSize(context, number, false); + } + + /** + * Like {@link #formatFileSize}, but trying to generate shorter numbers + * (showing fewer digits of precisin). + */ + public static String formatShortFileSize(Context context, long number) { + return formatFileSize(context, number, true); + } + + private static String formatFileSize(Context context, long number, boolean shorter) { if (context == null) { return ""; } @@ -58,13 +70,24 @@ public final class Formatter { suffix = com.android.internal.R.string.petabyteShort; result = result / 1024; } - if (result < 100) { - String value = String.format("%.2f", result); - return context.getResources(). - getString(com.android.internal.R.string.fileSizeSuffix, - value, context.getString(suffix)); + String value; + if (result < 1) { + value = String.format("%.2f", result); + } else if (result < 10) { + if (shorter) { + value = String.format("%.1f", result); + } else { + value = String.format("%.2f", result); + } + } else if (result < 100) { + if (shorter) { + value = String.format("%.0f", result); + } else { + value = String.format("%.2f", result); + } + } else { + value = String.format("%.0f", result); } - String value = String.format("%.0f", result); return context.getResources(). getString(com.android.internal.R.string.fileSizeSuffix, value, context.getString(suffix)); diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 45ff27e..cc5aeb1 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -314,7 +314,9 @@ public interface WindowManagerPolicy { public boolean showLw(boolean doAnimation); } - /** No transition happening. */ + /** Not set up for a transition. */ + public final int TRANSIT_UNSET = 0; + /** No animation for transition. */ public final int TRANSIT_NONE = 0; /** Window has been added to the screen. */ public final int TRANSIT_ENTER = 1; diff --git a/core/res/res/anim/activity_close_enter.xml b/core/res/res/anim/activity_close_enter.xml index 9d1ef53..f1258e8 100644 --- a/core/res/res/anim/activity_close_enter.xml +++ b/core/res/res/anim/activity_close_enter.xml @@ -21,5 +21,5 @@ android:interpolator="@anim/decelerate_interpolator" android:zAdjustment="top"> <translate android:fromXDelta="-100%" android:toXDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/activity_close_exit.xml b/core/res/res/anim/activity_close_exit.xml index 47cb6d6..bf3d8cd3 100644 --- a/core/res/res/anim/activity_close_exit.xml +++ b/core/res/res/anim/activity_close_exit.xml @@ -20,5 +20,5 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator"> <translate android:fromXDelta="0%" android:toXDelta="33%" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/activity_open_enter.xml b/core/res/res/anim/activity_open_enter.xml index e4c7e9b..a9ea381 100644 --- a/core/res/res/anim/activity_open_enter.xml +++ b/core/res/res/anim/activity_open_enter.xml @@ -20,5 +20,5 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator"> <translate android:fromXDelta="33%" android:toXDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/activity_open_exit.xml b/core/res/res/anim/activity_open_exit.xml index 9d47b7f..b04b79e 100644 --- a/core/res/res/anim/activity_open_exit.xml +++ b/core/res/res/anim/activity_open_exit.xml @@ -21,5 +21,5 @@ android:interpolator="@anim/decelerate_interpolator" android:zAdjustment="top"> <translate android:fromXDelta="0%" android:toXDelta="-100%" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/dialog_enter.xml b/core/res/res/anim/dialog_enter.xml index cc409e8..d4983c6 100644 --- a/core/res/res/anim/dialog_enter.xml +++ b/core/res/res/anim/dialog_enter.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- -/* //device/apps/common/res/anim/fade_in.xml -** +/* ** Copyright 2007, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/core/res/res/anim/dialog_exit.xml b/core/res/res/anim/dialog_exit.xml index 8bf8082..2aa629a 100644 --- a/core/res/res/anim/dialog_exit.xml +++ b/core/res/res/anim/dialog_exit.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- -/* //device/apps/common/res/anim/fade_out.xml -** +/* ** Copyright 2007, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +16,7 @@ ** limitations under the License. */ --> + <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/accelerate_interpolator"> <scale android:fromXScale="1.0" android:toXScale="0.9" diff --git a/core/res/res/anim/recent_enter.xml b/core/res/res/anim/recent_enter.xml index 54ae73b..8faa2c1 100644 --- a/core/res/res/anim/recent_enter.xml +++ b/core/res/res/anim/recent_enter.xml @@ -19,10 +19,10 @@ <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" + <scale android:fromXScale="0.9" android:toXScale="1.0" + android:fromYScale="0.9" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" - android:duration="@android:integer/config_mediumAnimTime" /> + android:duration="@android:integer/config_shortAnimTime" /> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime" /> </set> diff --git a/core/res/res/anim/recent_exit.xml b/core/res/res/anim/recent_exit.xml index 32d64a4..9399329 100644 --- a/core/res/res/anim/recent_exit.xml +++ b/core/res/res/anim/recent_exit.xml @@ -18,12 +18,11 @@ --> <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: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:duration="@android:integer/config_mediumAnimTime" /> - <alpha android:fromAlpha="1.0" android:toAlpha="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime" /> + <alpha android:fromAlpha="1.0" android:toAlpha="0.0" + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/task_open_exit.xml b/core/res/res/anim/task_open_exit.xml index 98975fb..db331b1 100644 --- a/core/res/res/anim/task_open_exit.xml +++ b/core/res/res/anim/task_open_exit.xml @@ -18,8 +18,7 @@ --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@anim/decelerate_interpolator" - android:zAdjustment="top"> + android:interpolator="@anim/decelerate_interpolator"> <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" diff --git a/core/res/res/anim/translucent_enter.xml b/core/res/res/anim/translucent_enter.xml index fb4c1c3..04852a8 100644 --- a/core/res/res/anim/translucent_enter.xml +++ b/core/res/res/anim/translucent_enter.xml @@ -20,7 +20,7 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator"> <translate android:fromXDelta="75%" android:toXDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/translucent_exit.xml b/core/res/res/anim/translucent_exit.xml index 1d424e1..adaf3d1 100644 --- a/core/res/res/anim/translucent_exit.xml +++ b/core/res/res/anim/translucent_exit.xml @@ -20,7 +20,7 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/accelerate_interpolator"> <translate android:fromXDelta="0%" android:toXDelta="75%" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> <alpha android:fromAlpha="1.0" android:toAlpha="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="@android:integer/config_shortAnimTime"/> </set> diff --git a/core/res/res/anim/wallpaper_close_enter.xml b/core/res/res/anim/wallpaper_close_enter.xml index e4c7e9b..0d13009 100644 --- a/core/res/res/anim/wallpaper_close_enter.xml +++ b/core/res/res/anim/wallpaper_close_enter.xml @@ -17,8 +17,22 @@ */ --> +<!-- This version zooms the new non-wallpaper down on top of the + wallpaper. --> +<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" /> +</set> + +<!-- This version is a variation on the inter-activity slide that + also scales the wallpaper. --> +<!-- <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator"> <translate android:fromXDelta="33%" android:toXDelta="0" android:duration="@android:integer/config_mediumAnimTime"/> </set> +--> diff --git a/core/res/res/anim/wallpaper_close_exit.xml b/core/res/res/anim/wallpaper_close_exit.xml index 16edec1..5d91e30 100644 --- a/core/res/res/anim/wallpaper_close_exit.xml +++ b/core/res/res/anim/wallpaper_close_exit.xml @@ -17,6 +17,22 @@ */ --> +<!-- This version zooms the new non-wallpaper down on top of the + wallpaper. The wallpaper here just stays fixed behind. --> +<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=".5" + android:fromYScale="1.0" android:toYScale=".5" + 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> + +<!-- This version is a variation on the inter-activity slide that + also scales the wallpaper. --> +<!-- <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator" android:zAdjustment="top"> @@ -27,3 +43,4 @@ <translate android:fromXDelta="0%" android:toXDelta="-100%" android:duration="@android:integer/config_mediumAnimTime"/> </set> +--> diff --git a/core/res/res/anim/wallpaper_open_enter.xml b/core/res/res/anim/wallpaper_open_enter.xml index af22b47..cf27cf0 100644 --- a/core/res/res/anim/wallpaper_open_enter.xml +++ b/core/res/res/anim/wallpaper_open_enter.xml @@ -17,6 +17,22 @@ */ --> +<!-- This version zooms the new non-wallpaper up off the wallpaper the + wallpaper. The wallpaper here just stays fixed behind. --> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@anim/decelerate_interpolator" + android:zAdjustment="top"> + <scale android:fromXScale=".5" android:toXScale="1.0" + android:fromYScale=".5" 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> + +<!-- This version is a variation on the inter-activity slide that + also scales the wallpaper. --> +<!-- <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator" android:zAdjustment="top"> @@ -27,3 +43,4 @@ <translate android:fromXDelta="-100%" android:toXDelta="0" android:duration="@android:integer/config_mediumAnimTime"/> </set> +--> diff --git a/core/res/res/anim/wallpaper_open_exit.xml b/core/res/res/anim/wallpaper_open_exit.xml index 47cb6d6..b7a539c 100644 --- a/core/res/res/anim/wallpaper_open_exit.xml +++ b/core/res/res/anim/wallpaper_open_exit.xml @@ -17,8 +17,22 @@ */ --> +<!-- This version zooms the new non-wallpaper down on top of the + wallpaper. --> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@anim/decelerate_interpolator"> + <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" /> +</set> + +<!-- This version is a variation on the inter-activity slide that + also scales the wallpaper. --> +<!-- <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator"> <translate android:fromXDelta="0%" android:toXDelta="33%" android:duration="@android:integer/config_mediumAnimTime"/> </set> +--> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 7695503..7aeaec4 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -27,13 +27,13 @@ <bool name="config_sf_limitedAlpha">false</bool> <!-- The duration (in milliseconds) of a short animation. --> - <integer name="config_shortAnimTime">100</integer> + <integer name="config_shortAnimTime">150</integer> <!-- The duration (in milliseconds) of a medium-length animation. --> - <integer name="config_mediumAnimTime">150</integer> + <integer name="config_mediumAnimTime">250</integer> <!-- The duration (in milliseconds) of a long animation. --> - <integer name="config_longAnimTime">300</integer> + <integer name="config_longAnimTime">400</integer> <!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION. Please don't copy them, copy anything else. --> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 35db8ee..bc8ec45 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -58,6 +58,19 @@ <item name="activityOpenExitAnimation">@anim/activity_open_exit</item> <item name="activityCloseEnterAnimation">@anim/activity_close_enter</item> <item name="activityCloseExitAnimation">@anim/activity_close_exit</item> + <item name="taskOpenEnterAnimation">@anim/activity_open_enter</item> + <item name="taskOpenExitAnimation">@anim/activity_open_exit</item> + <item name="taskCloseEnterAnimation">@anim/activity_close_enter</item> + <item name="taskCloseExitAnimation">@anim/activity_close_exit</item> + <item name="taskToFrontEnterAnimation">@anim/activity_open_enter</item> + <item name="taskToFrontExitAnimation">@anim/activity_open_exit</item> + <item name="taskToBackEnterAnimation">@anim/activity_close_enter</item> + <item name="taskToBackExitAnimation">@anim/activity_close_exit</item> + <!-- There is a good argument to be made that the user shouldn't + be aware of task transitions, so we are going to use the same + animation for them as we do for regular activity transitions. --> + <!-- These provide an alternative animation for task transitions. --> + <!-- <item name="taskOpenEnterAnimation">@anim/task_open_enter</item> <item name="taskOpenExitAnimation">@anim/task_open_exit</item> <item name="taskCloseEnterAnimation">@anim/task_close_enter</item> @@ -66,6 +79,7 @@ <item name="taskToFrontExitAnimation">@anim/task_open_exit</item> <item name="taskToBackEnterAnimation">@anim/task_close_enter</item> <item name="taskToBackExitAnimation">@anim/task_close_exit</item> + --> <item name="wallpaperOpenEnterAnimation">@anim/wallpaper_open_enter</item> <item name="wallpaperOpenExitAnimation">@anim/wallpaper_open_exit</item> <item name="wallpaperCloseEnterAnimation">@anim/wallpaper_close_enter</item> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index b29e571..fbdd247 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -354,7 +354,7 @@ <style name="Theme.NoDisplay"> <item name="android:windowBackground">@null</item> <item name="android:windowContentOverlay">@null</item> - <item name="android:windowIsTranslucent">false</item> + <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@null</item> <item name="android:windowDisablePreview">true</item> <item name="android:windowNoDisplay">true</item> diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index d5f1c61..db1b5f1 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -29,7 +29,7 @@ <integer name="def_screen_brightness">102</integer> <bool name="def_screen_brightness_automatic_mode">false</bool> <fraction name="def_window_animation_scale">100%</fraction> - <fraction name="def_window_transition_scale">0%</fraction> + <fraction name="def_window_transition_scale">100%</fraction> <bool name="def_bluetooth_on">false</bool> <bool name="def_install_non_market_apps">false</bool> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index f99eb58..c561078 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -71,7 +71,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // is properly propagated through your change. Not doing so will result in a loss of user // settings. - private static final int DATABASE_VERSION = 40; + private static final int DATABASE_VERSION = 41; private Context mContext; @@ -481,6 +481,27 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 40; } + if (upgradeVersion == 40) { + /* + * All animations are now turned on by default! + */ + db.beginTransaction(); + try { + db.execSQL("DELETE FROM system WHERE name='" + + Settings.System.WINDOW_ANIMATION_SCALE + "'"); + db.execSQL("DELETE FROM system WHERE name='" + + Settings.System.TRANSITION_ANIMATION_SCALE + "'"); + SQLiteStatement stmt = db.compileStatement("INSERT INTO system(name,value)" + + " VALUES(?,?);"); + loadDefaultAnimationSettings(stmt); + stmt.close(); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + upgradeVersion = 41; + } + if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index bbf2a24..3c76cf2 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -372,7 +372,7 @@ public class WindowManagerService extends IWindowManager.Stub // perform or TRANSIT_NONE if we are not waiting. If we are waiting, // mOpeningApps and mClosingApps are the lists of tokens that will be // made visible or hidden at the next transition. - int mNextAppTransition = WindowManagerPolicy.TRANSIT_NONE; + int mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET; boolean mAppTransitionReady = false; boolean mAppTransitionRunning = false; boolean mAppTransitionTimeout = false; @@ -932,7 +932,7 @@ public class WindowManagerService extends IWindowManager.Stub + " layer=" + highestTarget.mAnimLayer + " new layer=" + w.mAnimLayer); - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { // If we are currently setting up for an animation, // hold everything until we can find out what will happen. mInputMethodTargetWaitingAnim = true; @@ -1270,7 +1270,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { // If we are currently waiting for an app transition, and either // the current target or the next target are involved with it, // then hold off on doing anything with the wallpaper. @@ -2542,7 +2542,7 @@ public class WindowManagerService extends IWindowManager.Stub : com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation; break; } - a = loadAnimation(lp, animAttr); + a = animAttr != 0 ? loadAnimation(lp, animAttr) : null; if (DEBUG_ANIM) Log.v(TAG, "applyAnimation: wtoken=" + wtoken + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) @@ -2990,7 +2990,8 @@ public class WindowManagerService extends IWindowManager.Stub TAG, "Prepare app transition: transit=" + transit + " mNextAppTransition=" + mNextAppTransition); if (!mDisplayFrozen) { - if (mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET + || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) { mNextAppTransition = transit; } else if (transit == WindowManagerPolicy.TRANSIT_TASK_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_TASK_CLOSE) { @@ -3025,7 +3026,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { if (DEBUG_APP_TRANSITIONS) Log.v( TAG, "Execute app transition: mNextAppTransition=" + mNextAppTransition); - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mAppTransitionReady = true; final long origId = Binder.clearCallingIdentity(); performLayoutAndPlaceSurfacesLocked(); @@ -3228,7 +3229,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean runningAppAnimation = false; - if (transit != WindowManagerPolicy.TRANSIT_NONE) { + if (transit != WindowManagerPolicy.TRANSIT_UNSET) { if (wtoken.animation == sDummyAnimation) { wtoken.animation = null; } @@ -3328,7 +3329,7 @@ public class WindowManagerService extends IWindowManager.Stub // If we are preparing an app transition, then delay changing // the visibility of this token until we execute that transition. - if (!mDisplayFrozen && mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (!mDisplayFrozen && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { // Already in requested state, don't do anything more. if (wtoken.hiddenRequested != visible) { return; @@ -3367,7 +3368,7 @@ public class WindowManagerService extends IWindowManager.Stub } final long origId = Binder.clearCallingIdentity(); - setTokenVisibilityLocked(wtoken, null, visible, WindowManagerPolicy.TRANSIT_NONE, true); + setTokenVisibilityLocked(wtoken, null, visible, WindowManagerPolicy.TRANSIT_UNSET, true); wtoken.updateReportedVisibilityLocked(); Binder.restoreCallingIdentity(origId); } @@ -3493,13 +3494,13 @@ public class WindowManagerService extends IWindowManager.Stub mTokenList.remove(basewtoken); if (basewtoken != null && (wtoken=basewtoken.appWindowToken) != null) { if (DEBUG_APP_TRANSITIONS) Log.v(TAG, "Removing app token: " + wtoken); - delayed = setTokenVisibilityLocked(wtoken, null, false, WindowManagerPolicy.TRANSIT_NONE, true); + delayed = setTokenVisibilityLocked(wtoken, null, false, WindowManagerPolicy.TRANSIT_UNSET, true); wtoken.inPendingTransaction = false; mOpeningApps.remove(wtoken); wtoken.waitingToShow = false; if (mClosingApps.contains(wtoken)) { delayed = true; - } else if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + } else if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mClosingApps.add(wtoken); wtoken.waitingToHide = true; delayed = true; @@ -3781,7 +3782,7 @@ public class WindowManagerService extends IWindowManager.Stub AppWindowToken wt = findAppWindowToken(tokens.get(i)); if (wt != null) { mAppTokens.add(wt); - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mToTopApps.remove(wt); mToBottomApps.remove(wt); mToTopApps.add(wt); @@ -3791,7 +3792,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET) { moveAppWindowsLocked(tokens, mAppTokens.size()); } } @@ -3813,7 +3814,7 @@ public class WindowManagerService extends IWindowManager.Stub AppWindowToken wt = findAppWindowToken(tokens.get(i)); if (wt != null) { mAppTokens.add(pos, wt); - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mToTopApps.remove(wt); mToBottomApps.remove(wt); mToBottomApps.add(i, wt); @@ -3824,7 +3825,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET) { moveAppWindowsLocked(tokens, 0); } } @@ -7459,7 +7460,7 @@ public class WindowManagerService extends IWindowManager.Stub */ boolean isReadyForDisplay() { if (mRootToken.waitingToShow && - mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { return false; } final AppWindowToken atoken = mAppToken; @@ -8530,7 +8531,7 @@ public class WindowManagerService extends IWindowManager.Stub case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { if (DEBUG_APP_TRANSITIONS) Log.v(TAG, "*** APP TRANSITION TIMEOUT"); mAppTransitionReady = true; @@ -9074,9 +9075,9 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_APP_TRANSITIONS) Log.v(TAG, "**** GOOD TO GO"); int transit = mNextAppTransition; if (mSkipAppTransitionAnimation) { - transit = WindowManagerPolicy.TRANSIT_NONE; + transit = WindowManagerPolicy.TRANSIT_UNSET; } - mNextAppTransition = WindowManagerPolicy.TRANSIT_NONE; + mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET; mAppTransitionReady = false; mAppTransitionRunning = true; mAppTransitionTimeout = false; @@ -10092,8 +10093,8 @@ public class WindowManagerService extends IWindowManager.Stub } mDisplayFrozen = true; - if (mNextAppTransition != WindowManagerPolicy.TRANSIT_NONE) { - mNextAppTransition = WindowManagerPolicy.TRANSIT_NONE; + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { + mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET; mAppTransitionReady = true; } diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index d4f7207..82664eb 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -458,6 +458,13 @@ public final class ActivityManagerService extends ActivityManagerNative implemen = new ArrayList<HistoryRecord>(); /** + * Animations that for the current transition have requested not to + * be considered for the transition animation. + */ + final ArrayList<HistoryRecord> mNoAnimActivities + = new ArrayList<HistoryRecord>(); + + /** * List of intents that were used to start the most recent tasks. */ final ArrayList<TaskRecord> mRecentTasks @@ -2249,6 +2256,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen next.resumeKeyDispatchingLocked(); ensureActivitiesVisibleLocked(null, 0); mWindowManager.executeAppTransition(); + mNoAnimActivities.clear(); // Mark the point when the activity is resuming // TODO: To be more accurate, the mark should be before the onCreate, @@ -2565,6 +2573,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen // Make sure we have executed any pending transitions, since there // should be nothing left to do at this point. mWindowManager.executeAppTransition(); + mNoAnimActivities.clear(); return false; } @@ -2575,6 +2584,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen // Make sure we have executed any pending transitions, since there // should be nothing left to do at this point. mWindowManager.executeAppTransition(); + mNoAnimActivities.clear(); return false; } @@ -2637,17 +2647,25 @@ public final class ActivityManagerService extends ActivityManagerNative implemen if (prev.finishing) { if (DEBUG_TRANSITION) Log.v(TAG, "Prepare close transition: prev=" + prev); - mWindowManager.prepareAppTransition(prev.task == next.task - ? WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE - : WindowManagerPolicy.TRANSIT_TASK_CLOSE); + if (mNoAnimActivities.contains(prev)) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_NONE); + } else { + mWindowManager.prepareAppTransition(prev.task == next.task + ? WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE + : WindowManagerPolicy.TRANSIT_TASK_CLOSE); + } mWindowManager.setAppWillBeHidden(prev); mWindowManager.setAppVisibility(prev, false); } else { if (DEBUG_TRANSITION) Log.v(TAG, "Prepare open transition: prev=" + prev); - mWindowManager.prepareAppTransition(prev.task == next.task - ? WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN - : WindowManagerPolicy.TRANSIT_TASK_OPEN); + if (mNoAnimActivities.contains(next)) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_NONE); + } else { + mWindowManager.prepareAppTransition(prev.task == next.task + ? WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN + : WindowManagerPolicy.TRANSIT_TASK_OPEN); + } } if (false) { mWindowManager.setAppWillBeHidden(prev); @@ -2656,7 +2674,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } else if (mHistory.size() > 1) { if (DEBUG_TRANSITION) Log.v(TAG, "Prepare open transition: no previous"); - mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN); + if (mNoAnimActivities.contains(next)) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_NONE); + } else { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN); + } } if (next.app != null && next.app.thread != null) { @@ -2699,6 +2721,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen mHandler.sendEmptyMessage(RESUME_TOP_ACTIVITY_MSG); } mWindowManager.executeAppTransition(); + mNoAnimActivities.clear(); return true; } @@ -2859,9 +2882,18 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } if (DEBUG_TRANSITION) Log.v(TAG, "Prepare open transition: starting " + r); - mWindowManager.prepareAppTransition(newTask - ? WindowManagerPolicy.TRANSIT_TASK_OPEN - : WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN); + if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_NONE); + mNoAnimActivities.add(r); + } else if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_TASK_OPEN); + mNoAnimActivities.remove(r); + } else { + mWindowManager.prepareAppTransition(newTask + ? WindowManagerPolicy.TRANSIT_TASK_OPEN + : WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN); + mNoAnimActivities.remove(r); + } mWindowManager.addAppToken( addPos, r, r.task.taskId, r.info.screenOrientation, r.fullscreen); boolean doShow = true; @@ -3336,7 +3368,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen if (callerAtFront) { // We really do want to push this one into the // user's face, right now. - moveTaskToFrontLocked(taskTop.task); + moveTaskToFrontLocked(taskTop.task, r); } } // If the caller has requested that the target task be @@ -6922,14 +6954,14 @@ public final class ActivityManagerService extends ActivityManagerNative implemen for (int i=0; i<N; i++) { TaskRecord tr = mRecentTasks.get(i); if (tr.taskId == task) { - moveTaskToFrontLocked(tr); + moveTaskToFrontLocked(tr, null); return; } } for (int i=mHistory.size()-1; i>=0; i--) { HistoryRecord hr = (HistoryRecord)mHistory.get(i); if (hr.task.taskId == task) { - moveTaskToFrontLocked(hr.task); + moveTaskToFrontLocked(hr.task, null); return; } } @@ -6939,7 +6971,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } } - private final void moveTaskToFrontLocked(TaskRecord tr) { + private final void moveTaskToFrontLocked(TaskRecord tr, HistoryRecord reason) { if (DEBUG_SWITCH) Log.v(TAG, "moveTaskToFront: " + tr); final int task = tr.taskId; @@ -6950,10 +6982,6 @@ public final class ActivityManagerService extends ActivityManagerNative implemen return; } - if (DEBUG_TRANSITION) Log.v(TAG, - "Prepare to front transition: task=" + tr); - mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_TASK_TO_FRONT); - ArrayList moved = new ArrayList(); // Applying the affinities may have removed entries from the history, @@ -6982,6 +7010,19 @@ public final class ActivityManagerService extends ActivityManagerNative implemen pos--; } + if (DEBUG_TRANSITION) Log.v(TAG, + "Prepare to front transition: task=" + tr); + if (reason != null && + (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_NONE); + HistoryRecord r = topRunningActivityLocked(null); + if (r != null) { + mNoAnimActivities.add(r); + } + } else { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_TASK_TO_FRONT); + } + mWindowManager.moveAppTokensToTop(moved); if (VALIDATE_TOKENS) { mWindowManager.validateAppTokens(mHistory); @@ -7007,7 +7048,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } } final long origId = Binder.clearCallingIdentity(); - moveTaskToBackLocked(task); + moveTaskToBackLocked(task, null); Binder.restoreCallingIdentity(origId); } } @@ -7026,7 +7067,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen final long origId = Binder.clearCallingIdentity(); int taskId = getTaskForActivityLocked(token, !nonRoot); if (taskId >= 0) { - return moveTaskToBackLocked(taskId); + return moveTaskToBackLocked(taskId, null); } Binder.restoreCallingIdentity(origId); } @@ -7044,7 +7085,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen * @param task The taskId to collect and move to the bottom. * @return Returns true if the move completed, false if not. */ - private final boolean moveTaskToBackLocked(int task) { + private final boolean moveTaskToBackLocked(int task, HistoryRecord reason) { Log.i(TAG, "moveTaskToBack: " + task); // If we have a watcher, preflight the move before committing to it. First check @@ -7095,6 +7136,16 @@ public final class ActivityManagerService extends ActivityManagerNative implemen pos++; } + if (reason != null && + (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_NONE); + HistoryRecord r = topRunningActivityLocked(null); + if (r != null) { + mNoAnimActivities.add(r); + } + } else { + mWindowManager.prepareAppTransition(WindowManagerPolicy.TRANSIT_TASK_TO_FRONT); + } mWindowManager.moveAppTokensToBottom(moved); if (VALIDATE_TOKENS) { mWindowManager.validateAppTokens(mHistory); |