Example usage for android.os Build BOOTLOADER

List of usage examples for android.os Build BOOTLOADER

Introduction

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

Prototype

String BOOTLOADER

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

Click Source Link

Document

The system bootloader version number.

Usage

From source file:Main.java

public static String getBootloader() {
    return Build.BOOTLOADER;
}

From source file:Main.java

public static String getBuildInfo(Context context) {
    // get app version info
    String appVersion = "";
    PackageInfo pInfo;//from w  w  w  .  ja v  a 2  s  .  co  m
    try {
        pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
        appVersion = pInfo.versionName + " (" + pInfo.versionCode + ")\n";
    } catch (NameNotFoundException e) {
    }

    String board = "Board: " + Build.BOARD + "\n";
    String bootloader = "Bootloader: " + Build.BOOTLOADER + "\n";
    String brand = "Brand: " + Build.BRAND + "\n";
    String device = "Device: " + Build.DEVICE + "\n";
    String display = "Display: " + Build.DISPLAY + "\n";
    String product = "Product: " + Build.PRODUCT + "\n";
    String model = "Model: " + Build.MODEL + "\n";
    String manufacturer = "Manufacturer: " + Build.MANUFACTURER + "\n";

    return appVersion + board + bootloader + brand + device + display + product + model + manufacturer;
}

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

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

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

protected Device(@NonNull Context context) {
    mContext = context;//from w  w  w. java2 s.com

    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:com.stoutner.privacybrowser.AboutTabFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View tabLayout;//from w ww .j av a  2 s .  c  o m

    // Load the about tab layout.  Tab numbers start at 0.
    if (tabNumber == 0) {
        // Setting false at the end of inflater.inflate does not attach the inflated layout as a child of container.
        // The fragment will take care of attaching the root automatically.
        tabLayout = inflater.inflate(R.layout.about_tab_version, container, false);

        // Version.
        TextView versionNumberText = (TextView) tabLayout.findViewById(R.id.about_version_number_text);
        String version = getString(R.string.version) + " " + BuildConfig.VERSION_NAME + " ("
                + getString(R.string.version_code) + " " + Integer.toString(BuildConfig.VERSION_CODE) + ")";
        versionNumberText.setText(version);

        // Brand.
        TextView versionBrandText = (TextView) tabLayout.findViewById(R.id.about_version_brand_text);
        versionBrandText.setText(Build.BRAND);

        // Manufacturer.
        TextView versionManufacturerText = (TextView) tabLayout
                .findViewById(R.id.about_version_manufacturer_text);
        versionManufacturerText.setText(Build.MANUFACTURER);

        // Model.
        TextView versionModelText = (TextView) tabLayout.findViewById(R.id.about_version_model_text);
        versionModelText.setText(Build.MODEL);

        // Device.
        TextView versionDeviceText = (TextView) tabLayout.findViewById(R.id.about_version_device_text);
        versionDeviceText.setText(Build.DEVICE);

        // Bootloader.
        TextView versionBootloaderText = (TextView) tabLayout.findViewById(R.id.about_version_bootloader_text);
        versionBootloaderText.setText(Build.BOOTLOADER);

        // Radio.
        TextView versionRadioText = (TextView) tabLayout.findViewById(R.id.about_version_radio_text);
        // Hide versionRadioTextView if there is no radio.
        if (Build.getRadioVersion().equals("")) {
            TextView versionRadioTitle = (TextView) tabLayout.findViewById(R.id.about_version_radio_title);
            versionRadioTitle.setVisibility(View.GONE);
            versionRadioText.setVisibility(View.GONE);
        } else { // Else, set the text.
            versionRadioText.setText(Build.getRadioVersion());
        }

        // Android.
        TextView versionAndroidText = (TextView) tabLayout.findViewById(R.id.about_version_android_text);
        String android = Build.VERSION.RELEASE + " (" + getString(R.string.api) + " "
                + Integer.toString(Build.VERSION.SDK_INT) + ")";
        versionAndroidText.setText(android);

        // Build.
        TextView versionBuildText = (TextView) tabLayout.findViewById(R.id.about_version_build_text);
        versionBuildText.setText(Build.DISPLAY);

        // Security Patch.
        TextView versionSecurityPatchText = (TextView) tabLayout
                .findViewById(R.id.about_version_securitypatch_text);
        // Build.VERSION.SECURITY_PATCH is only available for SDK_INT >= 23.
        if (Build.VERSION.SDK_INT >= 23) {
            versionSecurityPatchText.setText(Build.VERSION.SECURITY_PATCH);
        } else { // Hide versionSecurityPatchTextView.
            TextView versionSecurityPatchTitle = (TextView) tabLayout
                    .findViewById(R.id.about_version_securitypatch_title);
            versionSecurityPatchTitle.setVisibility(View.GONE);
            versionSecurityPatchText.setVisibility(View.GONE);
        }

        // webViewLayout is only used to get the default user agent from about_tab_webview.  It is not used to render content on the screen.
        View webViewLayout = inflater.inflate(R.layout.about_tab_webview, container, false);
        WebView tabLayoutWebView = (WebView) webViewLayout.findViewById(R.id.about_tab_webview);
        String userAgentString = tabLayoutWebView.getSettings().getUserAgentString();

        // WebKit.
        TextView versionWebKitText = (TextView) tabLayout.findViewById(R.id.about_version_webkit_text);
        // Select the substring that begins after "Safari/" and goes to the end of the string.
        String webkitVersion = userAgentString.substring(userAgentString.indexOf("Safari/") + 7);
        versionWebKitText.setText(webkitVersion);

        // Chrome.
        TextView versionChromeText = (TextView) tabLayout.findViewById(R.id.about_version_chrome_text);
        // Select the substring that begins after "Chrome/" and goes until the next " ".
        String chromeVersion = userAgentString.substring(userAgentString.indexOf("Chrome/") + 7,
                userAgentString.indexOf(" ", userAgentString.indexOf("Chrome/")));
        versionChromeText.setText(chromeVersion);
    } else { // load a WebView for all the other tabs.  Tab numbers start at 0.
        // Setting false at the end of inflater.inflate does not attach the inflated layout as a child of container.
        // The fragment will take care of attaching the root automatically.
        tabLayout = inflater.inflate(R.layout.about_tab_webview, container, false);
        WebView tabWebView = (WebView) tabLayout;

        switch (tabNumber) {
        case 1:
            tabWebView.loadUrl("file:///android_asset/about_permissions.html");
            break;

        case 2:
            tabWebView.loadUrl("file:///android_asset/about_privacy_policy.html");
            break;

        case 3:
            tabWebView.loadUrl("file:///android_asset/about_changelog.html");
            break;

        case 4:
            tabWebView.loadUrl("file:///android_asset/about_license.html");
            break;

        case 5:
            tabWebView.loadUrl("file:///android_asset/about_contributors.html");
            break;

        case 6:
            tabWebView.loadUrl("file:///android_asset/about_links.html");

        default:
            break;
        }
    }

    return tabLayout;
}

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() }));

}

From source file:org.cook_e.cook_e.BugReportActivity.java

/**
 * Gathers information about the device running the application and returns it as a JSONObject
 * @return information about the system//from w  w w.  j av  a2s.c o  m
 */
private JSONObject getSystemInformation() {
    final JSONObject json = new JSONObject();

    try {
        final JSONObject build = new JSONObject();
        build.put("version_name", BuildConfig.VERSION_NAME);
        build.put("version_code", BuildConfig.VERSION_CODE);
        build.put("build_type", BuildConfig.BUILD_TYPE);
        build.put("debug", BuildConfig.DEBUG);

        json.put("build", build);

        final JSONObject device = new JSONObject();
        device.put("board", Build.BOARD);
        device.put("bootloader", Build.BOOTLOADER);
        device.put("brand", Build.BRAND);
        device.put("device", Build.DEVICE);
        device.put("display", Build.DISPLAY);
        device.put("fingerprint", Build.FINGERPRINT);
        device.put("hardware", Build.HARDWARE);
        device.put("host", Build.HOST);
        device.put("id", Build.ID);
        device.put("manufacturer", Build.MANUFACTURER);
        device.put("model", Build.MODEL);
        device.put("product", Build.PRODUCT);
        device.put("radio", Build.getRadioVersion());
        device.put("serial", Build.SERIAL);
        device.put("tags", Build.TAGS);
        device.put("time", Build.TIME);
        device.put("type", Build.TYPE);
        device.put("user", Build.USER);

        json.put("device", device);
    } catch (JSONException e) {
        // Ignore
    }

    return json;
}

From source file:com.framgia.android.emulator.EmulatorDetector.java

private boolean checkBasic() {
    boolean result = Build.FINGERPRINT.startsWith("generic") || Build.MODEL.contains("google_sdk")
            || Build.MODEL.toLowerCase().contains("droid4x") || Build.MODEL.contains("Emulator")
            || Build.MODEL.contains("Android SDK built for x86") || Build.MANUFACTURER.contains("Genymotion")
            || Build.HARDWARE.equals("goldfish") || Build.HARDWARE.equals("vbox86")
            || Build.PRODUCT.equals("sdk") || Build.PRODUCT.equals("google_sdk")
            || Build.PRODUCT.equals("sdk_x86") || Build.PRODUCT.equals("vbox86p")
            || Build.BOARD.toLowerCase().contains("nox") || Build.BOOTLOADER.toLowerCase().contains("nox")
            || Build.HARDWARE.toLowerCase().contains("nox") || Build.PRODUCT.toLowerCase().contains("nox")
            || Build.SERIAL.toLowerCase().contains("nox");

    if (result)/*  w  w w .j  a  va 2 s.  c o  m*/
        return true;
    result |= Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic");
    if (result)
        return true;
    result |= "google_sdk".equals(Build.PRODUCT);
    return result;
}

From source file:org.brandroid.openmanager.fragments.DialogHandler.java

public static String getDeviceInfo() {
    String ret = "";
    String sep = "\n";
    ret += sep + "Build Info:" + sep;
    ret += "SDK: " + Build.VERSION.SDK_INT + sep;
    if (OpenExplorer.SCREEN_WIDTH > -1)
        ret += "Screen: " + OpenExplorer.SCREEN_WIDTH + "x" + OpenExplorer.SCREEN_HEIGHT + sep;
    if (OpenExplorer.SCREEN_DPI > -1)
        ret += "DPI: " + OpenExplorer.SCREEN_DPI + sep;
    ret += "Lang: " + getLangCode() + sep;
    ret += "Fingerprint: " + Build.FINGERPRINT + sep;
    ret += "Manufacturer: " + Build.MANUFACTURER + sep;
    ret += "Model: " + Build.MODEL + sep;
    ret += "Product: " + Build.PRODUCT + sep;
    ret += "Brand: " + Build.BRAND + sep;
    ret += "Board: " + Build.BOARD + sep;
    ret += "Bootloader: " + Build.BOOTLOADER + sep;
    ret += "Hardware: " + Build.HARDWARE + sep;
    ret += "Display: " + Build.DISPLAY + sep;
    ret += "Language: " + Locale.getDefault().getDisplayLanguage() + sep;
    ret += "Country: " + Locale.getDefault().getDisplayCountry() + sep;
    ret += "Tags: " + Build.TAGS + sep;
    ret += "Type: " + Build.TYPE + sep;
    ret += "User: " + Build.USER + sep;
    if (Build.UNKNOWN != null)
        ret += "Unknown: " + Build.UNKNOWN + sep;
    ret += "ID: " + Build.ID;
    return ret;//w  w w .j  a v a  2s.  c  o  m
}