DisplayAdapter.java revision 4f67ba6ba4e861b287a3ff0323c107aa77f66264
1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.display;
18
19import android.view.Display;
20
21/**
22 * A display adapter makes a single display devices available to the system.
23 * <p>
24 * For now, all display adapters are registered in the system server but
25 * in principle it could be done from other processes.
26 * </p>
27 */
28public abstract class DisplayAdapter {
29    /** The current logical Display assignment for this adapter. Will change if other logical
30     * display is assigned to this adapter */
31    private int mDisplayId = Display.NO_DISPLAY;
32
33    /** Assign the displayId
34     * @hide */
35    public void setDisplayId(int displayId) {
36        mDisplayId = displayId;
37    }
38
39    /** Retrieve the displayId
40     * @hide */
41    public int getDisplayId() {
42        return mDisplayId;
43    }
44
45    /**
46     * Gets the display adapter name.
47     * @return The display adapter name.
48     */
49    public abstract String getName();
50
51    // TODO: dynamically register display devices
52    public abstract DisplayDevice getDisplayDevice();
53}
54