FileDocCategorySizeDatePackage
DisplayAdapter.javaAPI DocAndroid 5.1 API3967Thu Mar 12 22:22:42 GMT 2015com.android.server.display

DisplayAdapter

public abstract class DisplayAdapter extends Object
A display adapter makes zero or more display devices available to the system and provides facilities for discovering when displays are connected or disconnected.

For now, all display adapters are registered in the system server but in principle it could be done from other processes.

Display adapters are guarded by the {@link DisplayManagerService.SyncRoot} lock.

Fields Summary
private final DisplayManagerService.SyncRoot
mSyncRoot
private final android.content.Context
mContext
private final android.os.Handler
mHandler
private final Listener
mListener
private final String
mName
public static final int
DISPLAY_DEVICE_EVENT_ADDED
public static final int
DISPLAY_DEVICE_EVENT_CHANGED
public static final int
DISPLAY_DEVICE_EVENT_REMOVED
Constructors Summary
public DisplayAdapter(DisplayManagerService.SyncRoot syncRoot, android.content.Context context, android.os.Handler handler, Listener listener, String name)


    // Called with SyncRoot lock held.
      
                    
        mSyncRoot = syncRoot;
        mContext = context;
        mHandler = handler;
        mListener = listener;
        mName = name;
    
Methods Summary
public voiddumpLocked(java.io.PrintWriter pw)
Dumps the local state of the display adapter.

    
public final android.content.ContextgetContext()
Gets the display adapter's context.

        return mContext;
    
public final android.os.HandlergetHandler()
Gets a handler that the display adapter may use to post asynchronous messages.

        return mHandler;
    
public final java.lang.StringgetName()
Gets the display adapter name for debugging purposes.

        return mName;
    
public final DisplayManagerService.SyncRootgetSyncRoot()
Gets the object that the display adapter should synchronize on when handling calls that come in from outside of the display manager service.

        return mSyncRoot;
    
public voidregisterLocked()
Registers the display adapter with the display manager. The display adapter should register any built-in display devices as soon as possible. The boot process will wait for the default display to be registered. Other display devices can be registered dynamically later.

    
protected final voidsendDisplayDeviceEventLocked(DisplayDevice device, int event)
Sends a display device event to the display adapter listener asynchronously.

        mHandler.post(new Runnable() {
            @Override
            public void run() {
                mListener.onDisplayDeviceEvent(device, event);
            }
        });
    
protected final voidsendTraversalRequestLocked()
Sends a request to perform traversals.

        mHandler.post(new Runnable() {
            @Override
            public void run() {
                mListener.onTraversalRequested();
            }
        });