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 20 public class DeviceInfoDB { 21 public static enum Device { BLUELINE, BONITO, CROSSHATCH, CORAL, SARGO}; 22 public static final double DEFAULT_DENSITY_INDEPENDENT_WIDTH = 412.0; 23 getDeviceInfo(Device device)24 static DeviceInfo getDeviceInfo(Device device) { 25 switch (device) { 26 case BLUELINE: 27 return new DeviceInfo(1080, 2160, 1080/DEFAULT_DENSITY_INDEPENDENT_WIDTH, 17.42075974, 20.26, 30.26, 40.26, 50.26); 28 case CROSSHATCH: 29 return new DeviceInfo(1440, 2950, 1440/DEFAULT_DENSITY_INDEPENDENT_WIDTH, 20.42958729, 34.146, 44.146, 54.146, 64.146); 30 case BONITO: 31 case CORAL: 32 case SARGO: 33 // return Blueline for now. TODO needs correnct values for other devices 34 return new DeviceInfo(1080, 2160, 1080/DEFAULT_DENSITY_INDEPENDENT_WIDTH, 17.42075974, 20.26, 30.26, 40.26, 50.26); 35 } 36 return new DeviceInfo(1080, 2160, 1080/DEFAULT_DENSITY_INDEPENDENT_WIDTH, 17.42075974, 20.26, 30.26, 40.26, 50.26); 37 } 38 } 39