Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

android / dayu

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • dayu
  • ..
  • util
  • DeviceUtil.java
Find file
Normal viewHistoryPermalink
DeviceUtil.java 1.18 KB
Newer Older
mReturn's avatar
学习模块功能开发
d7f9680c
 
mReturn committed 5 years ago
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
package com.cjt2325.cameralibrary.util;

import android.os.Build;

/**
 * =====================================
 * 作    者: 陈嘉桐
 * 版    本:1.1.4
 * 创建日期:2017/6/9
 * 描    述:
 * =====================================
 */
public class DeviceUtil {

    private static String[] huaweiRongyao = {
            "hwH60",    //荣耀6
            "hwPE",     //荣耀6 plus
            "hwH30",    //3c
            "hwHol",    //3c畅玩版
            "hwG750",   //3x
            "hw7D",      //x1
            "hwChe2",      //x1
    };

    public static String getDeviceInfo() {
        String handSetInfo =
                "手机型号:" + Build.DEVICE +
                        "\n系统版本:" + Build.VERSION.RELEASE +
                        "\nSDK版本:" + Build.VERSION.SDK_INT;
        return handSetInfo;
    }

    public static String getDeviceModel() {
        return Build.DEVICE;
    }

    public static boolean isHuaWeiRongyao() {
        int length = huaweiRongyao.length;
        for (int i = 0; i < length; i++) {
            if (huaweiRongyao[i].equals(getDeviceModel())) {
                return true;
            }
        }
        return false;
    }
}