@Implements(value=android.hardware.display.DisplayManager.class,
minSdk=17)
public class ShadowDisplayManager
extends java.lang.Object
For tests, display properties may be changed and devices may be added or removed programmatically.
| Constructor and Description |
|---|
ShadowDisplayManager() |
| Modifier and Type | Method and Description |
|---|---|
static int |
addDisplay(java.lang.String qualifiersStr)
Adds a simulated display.
|
static void |
changeDisplay(int displayId,
java.lang.String qualifiersStr)
Changes properties of a simulated display.
|
static void |
configureDefaultDisplay(android.content.res.Configuration configuration,
android.util.DisplayMetrics displayMetrics)
internal only
|
static void |
removeDisplay(int displayId)
Removes a simulated display.
|
public static int addDisplay(java.lang.String qualifiersStr)
Adds a simulated display.
qualifiersStr - the Qualifiers string representing characteristics of the new display.public static void configureDefaultDisplay(android.content.res.Configuration configuration,
android.util.DisplayMetrics displayMetrics)
internal only
public static void changeDisplay(int displayId,
java.lang.String qualifiersStr)
Changes properties of a simulated display. If qualifiersStr starts with a plus (+) sign, the display’s previous configuration is modified with the given qualifiers; otherwise defaults are applied as described here.
displayId - the display id to changequalifiersStr - the Qualifiers string representing characteristics of the new displaypublic static void removeDisplay(int displayId)
Removes a simulated display.
displayId - the display id to remove