Skip to content

Commit fe75cb3

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Fix inflating of animations."
2 parents 6a6977e + 8962028 commit fe75cb3

4 files changed

Lines changed: 25 additions & 16 deletions

File tree

core/java/android/view/animation/AnimationSet.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ public AnimationSet(Context context, AttributeSet attrs) {
8989

9090
if (context.getApplicationInfo().targetSdkVersion >=
9191
Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
92-
if (a.hasValue(com.android.internal.R.styleable.Animation_duration)) {
92+
if (a.hasValue(com.android.internal.R.styleable.AnimationSet_duration)) {
9393
mFlags |= PROPERTY_DURATION_MASK;
9494
}
95-
if (a.hasValue(com.android.internal.R.styleable.Animation_fillBefore)) {
95+
if (a.hasValue(com.android.internal.R.styleable.AnimationSet_fillBefore)) {
9696
mFlags |= PROPERTY_FILL_BEFORE_MASK;
9797
}
98-
if (a.hasValue(com.android.internal.R.styleable.Animation_fillAfter)) {
98+
if (a.hasValue(com.android.internal.R.styleable.AnimationSet_fillAfter)) {
9999
mFlags |= PROPERTY_FILL_AFTER_MASK;
100100
}
101-
if (a.hasValue(com.android.internal.R.styleable.Animation_repeatMode)) {
101+
if (a.hasValue(com.android.internal.R.styleable.AnimationSet_repeatMode)) {
102102
mFlags |= PROPERTY_REPEAT_MODE_MASK;
103103
}
104-
if (a.hasValue(com.android.internal.R.styleable.Animation_startOffset)) {
104+
if (a.hasValue(com.android.internal.R.styleable.AnimationSet_startOffset)) {
105105
mFlags |= PROPERTY_START_OFFSET_MASK;
106106
}
107107
}

core/res/res/values/attrs.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3949,10 +3949,6 @@
39493949
<!-- ========================== -->
39503950
<eat-comment />
39513951

3952-
<declare-styleable name="AnimationSet">
3953-
<attr name="shareInterpolator" format="boolean" />
3954-
</declare-styleable>
3955-
39563952
<declare-styleable name="Animation">
39573953
<!-- Defines the interpolator used to smooth the animation movement in time. -->
39583954
<attr name="interpolator" />
@@ -4002,6 +3998,15 @@
40023998
<attr name="detachWallpaper" format="boolean" />
40033999
</declare-styleable>
40044000

4001+
<declare-styleable name="AnimationSet">
4002+
<attr name="shareInterpolator" format="boolean" />
4003+
<attr name="fillBefore" />
4004+
<attr name="fillAfter" />
4005+
<attr name="duration" />
4006+
<attr name="startOffset" />
4007+
<attr name="repeatMode" />
4008+
</declare-styleable>
4009+
40054010
<declare-styleable name="RotateAnimation">
40064011
<attr name="fromDegrees" />
40074012
<attr name="toDegrees" />

services/java/com/android/server/wm/ScreenRotationAnimation.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,12 @@ public boolean stepAnimation(long now) {
304304
}
305305

306306
if (!mStarted) {
307-
mEnterAnimation.setStartTime(now);
308-
mExitAnimation.setStartTime(now);
307+
if (mEnterAnimation != null) {
308+
mEnterAnimation.setStartTime(now);
309+
}
310+
if (mExitAnimation != null) {
311+
mExitAnimation.setStartTime(now);
312+
}
309313
mStarted = true;
310314
}
311315

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
774774
// The window manager only throws security exceptions, so let's
775775
// log all others.
776776
if (!(e instanceof SecurityException)) {
777-
Slog.e(TAG, "Window Manager Crash", e);
777+
Log.wtf(TAG, "Window Manager Crash", e);
778778
}
779779
throw e;
780780
}
@@ -7096,7 +7096,7 @@ private final void performLayoutAndPlaceSurfacesLocked() {
70967096
}
70977097
}
70987098
} catch (RuntimeException e) {
7099-
Slog.e(TAG, "Unhandled exception while force removing for memory", e);
7099+
Log.wtf(TAG, "Unhandled exception while force removing for memory", e);
71007100
}
71017101

71027102
try {
@@ -7131,7 +7131,7 @@ private final void performLayoutAndPlaceSurfacesLocked() {
71317131
}
71327132
} catch (RuntimeException e) {
71337133
mInLayout = false;
7134-
Slog.e(TAG, "Unhandled exception while layout out windows", e);
7134+
Log.wtf(TAG, "Unhandled exception while laying out windows", e);
71357135
}
71367136
}
71377137

@@ -8397,7 +8397,7 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
83978397
}
83988398
}
83998399
} catch (RuntimeException e) {
8400-
Slog.e(TAG, "Unhandled exception in Window Manager", e);
8400+
Log.wtf(TAG, "Unhandled exception in Window Manager", e);
84018401
}
84028402

84038403
Surface.closeTransaction();
@@ -9179,7 +9179,7 @@ void dumpWindowsLocked(FileDescriptor fd, PrintWriter pw, boolean dumpAll,
91799179
if (windows == null || windows.contains(w)) {
91809180
pw.print(" Window #"); pw.print(i); pw.print(' ');
91819181
pw.print(w); pw.println(":");
9182-
w.dump(pw, " ", dumpAll);
9182+
w.dump(pw, " ", dumpAll || windows != null);
91839183
}
91849184
}
91859185
if (mInputMethodDialogs.size() > 0) {

0 commit comments

Comments
 (0)