public abstract class DisplayManagerInternal extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
DisplayManagerInternal.DisplayPowerCallbacks
Asynchronous callbacks from the power controller to the power manager service.
|
static class |
DisplayManagerInternal.DisplayPowerRequest
Describes the requested power state of the display.
|
static interface |
DisplayManagerInternal.DisplayTransactionListener
Called within a Surface transaction whenever the size or orientation of a
display may have changed.
|
Constructor and Description |
---|
DisplayManagerInternal() |
Modifier and Type | Method and Description |
---|---|
abstract DisplayInfo |
getDisplayInfo(int displayId)
Returns information about the specified logical display.
|
abstract void |
initPowerManagement(DisplayManagerInternal.DisplayPowerCallbacks callbacks,
Handler handler,
SensorManager sensorManager)
Called by the power manager to initialize power management facilities.
|
abstract boolean |
isProximitySensorAvailable()
Returns true if the proximity sensor screen-off function is available.
|
abstract void |
performTraversalInTransactionFromWindowManager()
Called by the window manager to perform traversals while holding a
surface flinger transaction.
|
abstract void |
registerDisplayTransactionListener(DisplayManagerInternal.DisplayTransactionListener listener)
Registers a display transaction listener to provide the client a chance to
update its surfaces within the same transaction as any display layout updates.
|
abstract boolean |
requestPowerState(DisplayManagerInternal.DisplayPowerRequest request,
boolean waitForNegativeProximity)
Called by the power manager to request a new power state.
|
abstract void |
setDisplayInfoOverrideFromWindowManager(int displayId,
DisplayInfo info)
Overrides the display information of a particular logical display.
|
abstract void |
setDisplayOffsets(int displayId,
int x,
int y)
Applies an offset to the contents of a display, for example to avoid burn-in.
|
abstract void |
setDisplayProperties(int displayId,
boolean hasContent,
float requestedRefreshRate,
int requestedModeId,
boolean inTraversal)
Tells the display manager about properties of the display that depend on the windows on it.
|
abstract void |
unregisterDisplayTransactionListener(DisplayManagerInternal.DisplayTransactionListener listener)
Unregisters a display transaction listener to provide the client a chance to
update its surfaces within the same transaction as any display layout updates.
|
public abstract void initPowerManagement(DisplayManagerInternal.DisplayPowerCallbacks callbacks, Handler handler, SensorManager sensorManager)
public abstract boolean requestPowerState(DisplayManagerInternal.DisplayPowerRequest request, boolean waitForNegativeProximity)
The display power controller makes a copy of the provided object and then begins adjusting the power state to match what was requested.
request
- The requested power state.waitForNegativeProximity
- If true, issues a request to wait for
negative proximity before turning the screen back on, assuming the screen
was turned off by the proximity sensor.DisplayManagerInternal.DisplayPowerCallbacks.onStateChanged()
then try the request again later until the state converges.public abstract boolean isProximitySensorAvailable()
public abstract DisplayInfo getDisplayInfo(int displayId)
displayId
- The logical display id.public abstract void registerDisplayTransactionListener(DisplayManagerInternal.DisplayTransactionListener listener)
listener
- The listener to register.public abstract void unregisterDisplayTransactionListener(DisplayManagerInternal.DisplayTransactionListener listener)
listener
- The listener to unregister.public abstract void setDisplayInfoOverrideFromWindowManager(int displayId, DisplayInfo info)
displayId
- The logical display id.info
- The new data to be stored.public abstract void performTraversalInTransactionFromWindowManager()
public abstract void setDisplayProperties(int displayId, boolean hasContent, float requestedRefreshRate, int requestedModeId, boolean inTraversal)
If the display has unique content, then the display manager arranges for it to be presented on a physical display if appropriate. Otherwise, the display manager may choose to make the physical display mirror some other logical display.
If one of the windows on the display has a preferred refresh rate that's supported by the display, then the display manager will request its use.
displayId
- The logical display id to update.hasContent
- True if the logical display has content. This is used to control automatic
mirroring.requestedRefreshRate
- The preferred refresh rate for the top-most visible window that
has a preference.requestedModeId
- The preferred mode id for the top-most visible window that has a
preference.inTraversal
- True if called from WindowManagerService during a window traversal
prior to call to performTraversalInTransactionFromWindowManager.public abstract void setDisplayOffsets(int displayId, int x, int y)
TODO: Technically this should be associated with a physical rather than logical display but this is good enough for now.
displayId
- The logical display id to update.x
- The X offset by which to shift the contents of the display.y
- The Y offset by which to shift the contents of the display.