public final class DisplayInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
String |
address
Display address, or null if none.
|
int |
appHeight
The height of the portion of the display that is available to applications, in pixels.
|
long |
appVsyncOffsetNanos
This is a positive value indicating the phase offset of the VSYNC events provided by
Choreographer relative to the display refresh.
|
int |
appWidth
The width of the portion of the display that is available to applications, in pixels.
|
int |
colorMode
The active color mode.
|
static Parcelable.Creator<DisplayInfo> |
CREATOR |
int |
defaultModeId
The default display mode.
|
int |
flags
Display flags.
|
Display.HdrCapabilities |
hdrCapabilities
The display's HDR capabilities
|
int |
largestNominalAppHeight
The largest value of
appHeight that an application is likely to encounter,
in pixels, excepting cases where the height may be even larger due to system decorations
such as the status bar being hidden, for example. |
int |
largestNominalAppWidth
The largest value of
appWidth that an application is likely to encounter,
in pixels, excepting cases where the width may be even larger due to system decorations
such as the status bar being hidden, for example. |
int |
layerStack
The surface flinger layer stack associated with this logical display.
|
int |
logicalDensityDpi
The logical display density which is the basis for density-independent
pixels.
|
int |
logicalHeight
The logical height of the display, in pixels.
|
int |
logicalWidth
The logical width of the display, in pixels.
|
int |
modeId
The active display mode.
|
String |
name
The human-readable name of the display.
|
int |
overscanBottom |
int |
overscanLeft |
int |
overscanRight |
int |
overscanTop |
String |
ownerPackageName
The package name of the application that owns this display, or null if it is
owned by the system.
|
int |
ownerUid
The UID of the application that owns this display, or zero if it is owned by the system.
|
float |
physicalXDpi
The exact physical pixels per inch of the screen in the X dimension.
|
float |
physicalYDpi
The exact physical pixels per inch of the screen in the Y dimension.
|
long |
presentationDeadlineNanos
This is how far in advance a buffer must be queued for presentation at
a given time.
|
int |
rotation
The rotation of the display relative to its natural orientation.
|
int |
smallestNominalAppHeight
The smallest value of
appHeight that an application is likely to encounter,
in pixels, excepting cases where the height may be even smaller due to the presence
of a soft keyboard, for example. |
int |
smallestNominalAppWidth
The smallest value of
appWidth that an application is likely to encounter,
in pixels, excepting cases where the width may be even smaller due to the presence
of a soft keyboard, for example. |
int |
state
The state of the display, such as
Display.STATE_ON . |
int[] |
supportedColorModes
The list of supported color modes
|
Display.Mode[] |
supportedModes
The supported modes of this display.
|
int |
type
Display type.
|
String |
uniqueId
Unique identifier for the display.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
DisplayInfo() |
DisplayInfo(DisplayInfo other) |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(DisplayInfo other) |
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
boolean |
equals(DisplayInfo other) |
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
int |
findDefaultModeByRefreshRate(float refreshRate)
Returns the id of the "default" mode with the given refresh rate, or
0 if no suitable
mode could be found. |
void |
getAppMetrics(DisplayMetrics outMetrics) |
void |
getAppMetrics(DisplayMetrics outMetrics,
CompatibilityInfo ci,
Configuration configuration) |
void |
getAppMetrics(DisplayMetrics outMetrics,
DisplayAdjustments displayAdjustments) |
Display.Mode |
getDefaultMode() |
float[] |
getDefaultRefreshRates()
Returns the list of supported refresh rates in the default mode.
|
void |
getLogicalMetrics(DisplayMetrics outMetrics,
CompatibilityInfo compatInfo,
Configuration configuration) |
Display.Mode |
getMode() |
int |
getNaturalHeight() |
int |
getNaturalWidth() |
boolean |
hasAccess(int uid)
Returns true if the specified UID has access to this display.
|
int |
hashCode()
Returns a hash code value for the object.
|
void |
readFromParcel(Parcel source) |
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public int layerStack
public int flags
public int type
public String address
public String name
public String uniqueId
public int appWidth
public int appHeight
public int smallestNominalAppWidth
appWidth
that an application is likely to encounter,
in pixels, excepting cases where the width may be even smaller due to the presence
of a soft keyboard, for example.public int smallestNominalAppHeight
appHeight
that an application is likely to encounter,
in pixels, excepting cases where the height may be even smaller due to the presence
of a soft keyboard, for example.public int largestNominalAppWidth
appWidth
that an application is likely to encounter,
in pixels, excepting cases where the width may be even larger due to system decorations
such as the status bar being hidden, for example.public int largestNominalAppHeight
appHeight
that an application is likely to encounter,
in pixels, excepting cases where the height may be even larger due to system decorations
such as the status bar being hidden, for example.public int logicalWidth
public int logicalHeight
public int overscanLeft
public int overscanTop
public int overscanRight
public int overscanBottom
public int rotation
Surface.ROTATION_0
,
Surface.ROTATION_90
, Surface.ROTATION_180
,
Surface.ROTATION_270
.
The value of this field is indeterminate if the logical display is presented on more than one physical display.
public int modeId
public int defaultModeId
public Display.Mode[] supportedModes
public int colorMode
public int[] supportedColorModes
public Display.HdrCapabilities hdrCapabilities
public int logicalDensityDpi
public float physicalXDpi
The value of this field is indeterminate if the logical display is presented on more than one physical display.
public float physicalYDpi
The value of this field is indeterminate if the logical display is presented on more than one physical display.
public long appVsyncOffsetNanos
public long presentationDeadlineNanos
public int state
Display.STATE_ON
.public int ownerUid
If the display is private, then only the owner can use it.
public String ownerPackageName
If the display is private, then only the owner can use it.
public static final Parcelable.Creator<DisplayInfo> CREATOR
public DisplayInfo()
public DisplayInfo(DisplayInfo other)
public boolean equals(Object o)
Object
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
equals
in class Object
o
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
public boolean equals(DisplayInfo other)
public int hashCode()
Object
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
JavaTM programming language.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public void copyFrom(DisplayInfo other)
public void readFromParcel(Parcel source)
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public Display.Mode getMode()
public Display.Mode getDefaultMode()
public int findDefaultModeByRefreshRate(float refreshRate)
0
if no suitable
mode could be found.public float[] getDefaultRefreshRates()
public void getAppMetrics(DisplayMetrics outMetrics)
public void getAppMetrics(DisplayMetrics outMetrics, DisplayAdjustments displayAdjustments)
public void getAppMetrics(DisplayMetrics outMetrics, CompatibilityInfo ci, Configuration configuration)
public void getLogicalMetrics(DisplayMetrics outMetrics, CompatibilityInfo compatInfo, Configuration configuration)
public int getNaturalWidth()
public int getNaturalHeight()
public boolean hasAccess(int uid)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())