Merge change 7613 into donut
* changes: * Use Fede In/Out animation if one of opening/closing apps is in compatibility mode. * preserve compatibility window flag when the app updates window's layout params. * Added assertion in DEFAULT_COMPATIBILITY_INFO object to prevent unintentional modification. * A few minor updates * log/dump message improvement * Removed unnecessary method in FadeInOutAnimator * Fixed 100 char issue in WindwoManagerServer.java
This commit is contained in:
@@ -38,7 +38,12 @@ public class CompatibilityInfo {
|
||||
private static final String TAG = "CompatibilityInfo";
|
||||
|
||||
/** default compatibility info object for compatible applications */
|
||||
public static final CompatibilityInfo DEFAULT_COMPATIBILITY_INFO = new CompatibilityInfo();
|
||||
public static final CompatibilityInfo DEFAULT_COMPATIBILITY_INFO = new CompatibilityInfo() {
|
||||
@Override
|
||||
public void setExpandable(boolean expandable) {
|
||||
throw new UnsupportedOperationException("trying to change default compatibility info");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The default width of the screen in portrait mode.
|
||||
@@ -191,7 +196,7 @@ public class CompatibilityInfo {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CompatibilityInfo{scale=" + applicationScale +
|
||||
", compatibility flag=" + mCompatibilityFlags + "}";
|
||||
", supports screen=" + supportsScreen() + "}";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -497,8 +497,12 @@ public final class ViewRoot extends Handler implements ViewParent,
|
||||
void setLayoutParams(WindowManager.LayoutParams attrs, boolean newView) {
|
||||
synchronized (this) {
|
||||
int oldSoftInputMode = mWindowAttributes.softInputMode;
|
||||
// preserve compatible window flag if exists.
|
||||
int compatibleWindowFlag =
|
||||
mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW;
|
||||
mWindowAttributes.copyFrom(attrs);
|
||||
|
||||
mWindowAttributes.flags |= compatibleWindowFlag;
|
||||
|
||||
if (newView) {
|
||||
mSoftInputMode = attrs.softInputMode;
|
||||
requestLayout();
|
||||
@@ -1301,7 +1305,8 @@ public final class ViewRoot extends Handler implements ViewParent,
|
||||
if (DEBUG_DRAW) {
|
||||
Context cxt = mView.getContext();
|
||||
Log.i(TAG, "Drawing: package:" + cxt.getPackageName() +
|
||||
", metrics=" + mView.getContext().getResources().getDisplayMetrics());
|
||||
", metrics=" + cxt.getResources().getDisplayMetrics() +
|
||||
", compatibilityInfo=" + cxt.getResources().getCompatibilityInfo());
|
||||
}
|
||||
int saveCount = canvas.save(Canvas.MATRIX_SAVE_FLAG);
|
||||
try {
|
||||
|
||||
@@ -986,6 +986,9 @@ public interface WindowManager extends ViewManager {
|
||||
sb.append(" or=");
|
||||
sb.append(screenOrientation);
|
||||
}
|
||||
if ((flags & FLAG_COMPATIBLE_WINDOW) != 0) {
|
||||
sb.append(" compatible=true");
|
||||
}
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user