DisplayDeviceInfo.java revision 908aecc3a63c5520d5b11da14a9383f885b7d126
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 19/** 20 * Describes the characteristics of a physical display device. 21 */ 22public final class DisplayDeviceInfo { 23 /** 24 * The width of the display in its natural orientation, in pixels. 25 * This value is not affected by display rotation. 26 */ 27 public int width; 28 29 /** 30 * The height of the display in its natural orientation, in pixels. 31 * This value is not affected by display rotation. 32 */ 33 public int height; 34 35 public float refreshRate; 36 public int densityDpi; 37 public float xDpi; 38 public float yDpi; 39 40 public void copyFrom(DisplayDeviceInfo other) { 41 width = other.width; 42 height = other.height; 43 refreshRate = other.refreshRate; 44 densityDpi = other.densityDpi; 45 xDpi = other.xDpi; 46 yDpi = other.yDpi; 47 } 48 49 @Override 50 public String toString() { 51 return width + " x " + height + ", " + refreshRate + " fps, " 52 + "density " + densityDpi + ", " + xDpi + " x " + yDpi + " dpi"; 53 } 54} 55