Example usage for android.os Build DISPLAY

List of usage examples for android.os Build DISPLAY

Introduction

In this page you can find the example usage for android.os Build DISPLAY.

Prototype

String DISPLAY

To view the source code for android.os Build DISPLAY.

Click Source Link

Document

A build ID string meant for displaying to the user

Usage

From source file:Main.java

public static String getDeviceId(Context context) {
    // IMEI, if present
    TelephonyManager telephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    String imei = telephonyMgr.getDeviceId(); // Requires READ_PHONE_STATE
    if (imei != null)
        return imei;

    String devId = "35" + //we make this look like a valid IMEI
            Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10
            + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10
            + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10
            + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10
            + Build.USER.length() % 10; //13 digits

    return devId;
}

From source file:Main.java

public static String collectStats(CharSequence flattenedParams) {
    StringBuilder result = new StringBuilder(1000);

    result.append("BOARD=").append(Build.BOARD).append('\n');
    result.append("BRAND=").append(Build.BRAND).append('\n');
    result.append("CPU_ABI=").append(Build.CPU_ABI).append('\n');
    result.append("DEVICE=").append(Build.DEVICE).append('\n');
    result.append("DISPLAY=").append(Build.DISPLAY).append('\n');
    result.append("FINGERPRINT=").append(Build.FINGERPRINT).append('\n');
    result.append("HOST=").append(Build.HOST).append('\n');
    result.append("ID=").append(Build.ID).append('\n');
    result.append("MANUFACTURER=").append(Build.MANUFACTURER).append('\n');
    result.append("MODEL=").append(Build.MODEL).append('\n');
    result.append("PRODUCT=").append(Build.PRODUCT).append('\n');
    result.append("TAGS=").append(Build.TAGS).append('\n');
    result.append("TIME=").append(Build.TIME).append('\n');
    result.append("TYPE=").append(Build.TYPE).append('\n');
    result.append("USER=").append(Build.USER).append('\n');
    result.append("VERSION.CODENAME=").append(Build.VERSION.CODENAME).append('\n');
    result.append("VERSION.INCREMENTAL=").append(Build.VERSION.INCREMENTAL).append('\n');
    result.append("VERSION.RELEASE=").append(Build.VERSION.RELEASE).append('\n');
    result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n');

    if (flattenedParams != null) {
        String[] params = SEMICOLON.split(flattenedParams);
        Arrays.sort(params);/*from  w  w  w. j  av  a2 s.  co m*/
        for (String param : params) {
            result.append(param).append('\n');
        }
    }

    return result.toString();
}

From source file:Main.java

public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }/*from   w w w  .j ava 2 s.c  o m*/

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}

From source file:cc.softwarefactory.lokki.android.utilities.Utils.java

public static String getDeviceId() {

    return "35" + //we make this look like a valid IMEI
            Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.SERIAL.length() % 10
            + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10
            + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10
            + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10
            + Build.USER.length() % 10; //13 digits
}

From source file:org.chromium.latency.walt.AboutFragment.java

@Override
public void onResume() {
    super.onResume();
    TextView textView = (TextView) getActivity().findViewById(R.id.txt_build_info);
    String text = String.format("WALT v%s  (versionCode=%d)\n", BuildConfig.VERSION_NAME,
            BuildConfig.VERSION_CODE);/*  w w w  .j a  v a  2 s .  c  o m*/
    text += "WALT protocol version: " + WaltDevice.PROTOCOL_VERSION + "\n";
    text += "Android Build ID: " + Build.DISPLAY + "\n";
    text += "Android API Level: " + Build.VERSION.SDK_INT + "\n";
    text += "Android OS Version: " + System.getProperty("os.version");
    textView.setText(text);
}

From source file:com.anysoftkeyboard.ui.dev.DeveloperUtils.java

public static String getSysInfo(@Nullable Context context) {
    StringBuilder sb = new StringBuilder();
    sb.append("BRAND:").append(Build.BRAND).append(NEW_LINE);
    sb.append("DEVICE:").append(Build.DEVICE).append(NEW_LINE);
    sb.append("Build ID:").append(Build.DISPLAY).append(NEW_LINE);
    sb.append("changelist number:").append(Build.ID).append("\n");
    sb.append("MODEL:").append(Build.MODEL).append(NEW_LINE);
    sb.append("PRODUCT:").append(Build.PRODUCT).append(NEW_LINE);
    sb.append("TAGS:").append(Build.TAGS).append(NEW_LINE);
    sb.append("VERSION.INCREMENTAL:").append(Build.VERSION.INCREMENTAL).append(NEW_LINE);
    sb.append("VERSION.RELEASE:").append(Build.VERSION.RELEASE).append(NEW_LINE);
    sb.append("VERSION.SDK_INT:").append(Build.VERSION.SDK_INT).append(NEW_LINE);
    if (context != null && context.getResources() != null
            && context.getResources().getConfiguration() != null) {
        Configuration configuration = context.getResources().getConfiguration();
        sb.append("Locale:").append(configuration.locale).append(NEW_LINE);
        sb.append("configuration:").append(configuration.toString()).append(NEW_LINE);
    }/* ww  w .ja  v a  2 s.  c  om*/

    sb.append("That's all I know.");
    return sb.toString();
}

From source file:com.otaupdater.ROMTab.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    cfg = Config.getInstance(getActivity().getApplicationContext());

    HashMap<String, Object> item;

    item = new HashMap<String, Object>();
    item.put(KEY_TITLE, getString(R.string.main_device));
    item.put(KEY_SUMMARY, android.os.Build.DEVICE.toLowerCase(Locale.US));
    item.put(KEY_ICON, R.drawable.ic_device);
    DATA.add(item);//from w  w w.ja  va 2  s.co  m

    item = new HashMap<String, Object>();
    item.put(KEY_TITLE, getString(R.string.main_rom));
    item.put(KEY_SUMMARY, android.os.Build.DISPLAY);
    item.put(KEY_ICON, R.drawable.ic_info_outline);
    DATA.add(item);

    String romVersion = PropUtils.getRomOtaVersion();
    if (romVersion == null)
        romVersion = PropUtils.getRomVersion();

    if (PropUtils.isRomOtaEnabled()) {
        Date romDate = PropUtils.getRomOtaDate();
        if (romDate != null) {
            romVersion += " (" + DateFormat.getDateTimeInstance().format(romDate) + ")";
        }

        item = new HashMap<String, Object>();
        item.put(KEY_TITLE, getString(R.string.rom_version));
        item.put(KEY_SUMMARY, romVersion);
        item.put(KEY_ICON, R.drawable.ic_settings);
        DATA.add(item);

        item = new HashMap<String, Object>();
        item.put(KEY_TITLE, getString(R.string.main_otaid));
        item.put(KEY_SUMMARY, PropUtils.getRomOtaID());
        item.put(KEY_ICON, R.drawable.ic_key);
        DATA.add(item);

        item = new HashMap<String, Object>();
        item.put(KEY_TITLE, getString(R.string.updates_avail_title));
        if (cfg.hasStoredRomUpdate()) {
            RomInfo info = cfg.getStoredRomUpdate();
            if (info.isUpdate()) {
                item.put(KEY_SUMMARY, getString(R.string.updates_new, info.name, info.version));
            } else {
                item.put(KEY_SUMMARY, getString(R.string.updates_none));
                cfg.clearStoredRomUpdate();
            }
        } else {
            item.put(KEY_SUMMARY, getString(R.string.updates_none));
        }
        item.put(KEY_ICON, R.drawable.ic_cloud_download);
        AVAIL_UPDATES_IDX = DATA.size();
        DATA.add(item);
    } else {
        if (cfg.hasStoredRomUpdate())
            cfg.clearStoredRomUpdate();

        if (!romVersion.equals(Build.DISPLAY)) {
            item = new HashMap<String, Object>();
            item.put(KEY_TITLE, getString(R.string.rom_version));
            item.put(KEY_SUMMARY, romVersion);
            item.put(KEY_ICON, R.drawable.ic_settings);
            DATA.add(item);
        }

        item = new HashMap<String, Object>();
        item.put(KEY_TITLE, getString(R.string.rom_unsupported));
        item.put(KEY_SUMMARY, getString(R.string.rom_unsupported_summary));
        item.put(KEY_ICON, R.drawable.ic_cloud_off);
        DATA.add(item);
    }
}

From source file:at.amartinz.hardware.device.Device.java

protected Device(@NonNull Context context) {
    mContext = context;//from   www  .  j  av  a 2s.co  m

    platformVersion = Build.VERSION.RELEASE;
    platformId = Build.DISPLAY;
    platformType = Build.VERSION.CODENAME + " " + Build.TYPE;
    platformTags = Build.TAGS;
    platformBuildType = HwUtils.getDate(Build.TIME);

    vmVersion = System.getProperty("java.vm.version", "-");
    vmLibrary = getRuntime();

    final Resources res = context.getResources();
    screenWidth = res.getDisplayMetrics().widthPixels;
    screenHeight = res.getDisplayMetrics().heightPixels;

    androidId = getAndroidId(context);
    manufacturer = Build.MANUFACTURER;
    model = Build.MODEL;
    device = Build.DEVICE;
    product = Build.PRODUCT;
    board = Build.BOARD;
    bootloader = Build.BOOTLOADER;
    radio = Build.getRadioVersion();

    // initialize defaults
    hasBusyBox = false;
    hasRoot = false;
    suVersion = "-";
    isSELinuxEnforcing = isSELinuxEnforcing(); // ehm, alright, if you say so...
}

From source file:rus.cpuinfo.AndroidDepedentModel.SysInfo.java

@NonNull
private String getBuildId() {
    return Build.DISPLAY != null ? Build.DISPLAY : StringUtils.EMPTY;
}

From source file:com.fallahpoor.infocenter.fragments.GeneralFragment.java

private ArrayList<String> getSubItemsArrayList() {

    return new ArrayList<>(Arrays.asList(new String[] { Build.MANUFACTURER, Build.BRAND, Build.DEVICE,
            Build.BOOTLOADER, Build.DISPLAY, Build.FINGERPRINT, getDeviceID(), Build.SERIAL,
            getRadioFirmwareVersion(), getFormattedUptime() }));

}