1 /* 2 * Copyright (C) 2020 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 17 package com.android.framebufferizer.utils; 18 19 public class DeviceInfo { 20 final private int widthPx; 21 final private int heightPx; 22 final private double dp2px; 23 final private double mm2px; 24 final private double powerButtonTopMm; 25 final private double powerButtonBottomMm; 26 final private double volUpButtonTopMm; 27 final private double volUpButtonBottomMm; 28 DeviceInfo(int widthPx, int heightPx, double dp2px, double mm2px, double powerButtonTopMm, double powerButtonBottomMm, double volUpButtonTopMm, double volUpButtonBottomMm)29 DeviceInfo(int widthPx, int heightPx, double dp2px, double mm2px, double powerButtonTopMm, 30 double powerButtonBottomMm, double volUpButtonTopMm, double volUpButtonBottomMm) { 31 this.widthPx = widthPx; 32 this.heightPx = heightPx; 33 this.dp2px = dp2px; 34 this.mm2px = mm2px; 35 this.powerButtonTopMm = powerButtonTopMm; 36 this.powerButtonBottomMm = powerButtonBottomMm; 37 this.volUpButtonTopMm = volUpButtonTopMm; 38 this.volUpButtonBottomMm = volUpButtonBottomMm; 39 } 40 getWidthPx()41 public int getWidthPx() { 42 return widthPx; 43 } 44 getHeightPx()45 public int getHeightPx() { 46 return heightPx; 47 } 48 getDp2px()49 public double getDp2px() { 50 return dp2px; 51 } 52 getMm2px()53 public double getMm2px() { 54 return mm2px; 55 } 56 getPowerButtonTopMm()57 public double getPowerButtonTopMm() { 58 return powerButtonTopMm; 59 } 60 getPowerButtonBottomMm()61 public double getPowerButtonBottomMm() { 62 return powerButtonBottomMm; 63 } 64 getVolUpButtonTopMm()65 public double getVolUpButtonTopMm() { 66 return volUpButtonTopMm; 67 } 68 getVolUpButtonBottomMm()69 public double getVolUpButtonBottomMm() { 70 return volUpButtonBottomMm; 71 } 72 } 73