FileDocCategorySizeDatePackage
WindowInfo.javaAPI DocAndroid 5.1 API4895Thu Mar 12 22:22:10 GMT 2015android.view

WindowInfo

public class WindowInfo extends Object implements android.os.Parcelable
This class represents information about a window from the window manager to another part of the system.
hide

Fields Summary
private static final int
MAX_POOL_SIZE
private static final Pools.SynchronizedPool
sPool
public int
type
public int
layer
public android.os.IBinder
token
public android.os.IBinder
parentToken
public boolean
focused
public final android.graphics.Rect
boundsInScreen
public List
childTokens
public static final Parcelable.Creator
CREATOR
Constructors Summary
private WindowInfo()


      
        /* do nothing - hide constructor */
    
Methods Summary
private voidclear()

        type = 0;
        layer = 0;
        token = null;
        parentToken = null;
        focused = false;
        boundsInScreen.setEmpty();
        if (childTokens != null) {
            childTokens.clear();
        }
    
public intdescribeContents()

        return 0;
    
private voidinitFromParcel(android.os.Parcel parcel)

        type = parcel.readInt();
        layer = parcel.readInt();
        token = parcel.readStrongBinder();
        parentToken = parcel.readStrongBinder();
        focused = (parcel.readInt() == 1);
        boundsInScreen.readFromParcel(parcel);

        final boolean hasChildren = (parcel.readInt() == 1);
        if (hasChildren) {
            if (childTokens == null) {
                childTokens = new ArrayList<IBinder>();
            }
            parcel.readBinderList(childTokens);
        }
    
public static android.view.WindowInfoobtain()

        WindowInfo window = sPool.acquire();
        if (window == null) {
            window = new WindowInfo();
        }
        return window;
    
public static android.view.WindowInfoobtain(android.view.WindowInfo other)

        WindowInfo window = obtain();
        window.type = other.type;
        window.layer = other.layer;
        window.token = other.token;
        window.parentToken = other.parentToken;
        window.focused = other.focused;
        window.boundsInScreen.set(other.boundsInScreen);

        if (other.childTokens != null && !other.childTokens.isEmpty()) {
            if (window.childTokens == null) {
                window.childTokens = new ArrayList<IBinder>(other.childTokens);
            } else {
                window.childTokens.addAll(other.childTokens);
            }
        }

        return window;
    
public voidrecycle()

        clear();
        sPool.release(this);
    
public java.lang.StringtoString()

        StringBuilder builder = new StringBuilder();
        builder.append("WindowInfo[");
        builder.append("type=").append(type);
        builder.append(", layer=").append(layer);
        builder.append(", token=").append(token);
        builder.append(", bounds=").append(boundsInScreen);
        builder.append(", parent=").append(parentToken);
        builder.append(", focused=").append(focused);
        builder.append(", children=").append(childTokens);
        builder.append(']");
        return builder.toString();
    
public voidwriteToParcel(android.os.Parcel parcel, int flags)

        parcel.writeInt(type);
        parcel.writeInt(layer);
        parcel.writeStrongBinder(token);
        parcel.writeStrongBinder(parentToken);
        parcel.writeInt(focused ? 1 : 0);
        boundsInScreen.writeToParcel(parcel, flags);

        if (childTokens != null && !childTokens.isEmpty()) {
            parcel.writeInt(1);
            parcel.writeBinderList(childTokens);
        } else {
            parcel.writeInt(0);
        }