Example usage for android.os Build MODEL

List of usage examples for android.os Build MODEL

Introduction

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

Prototype

String MODEL

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

Click Source Link

Document

The end-user-visible name for the end product.

Usage

From source file:com.microsoft.aad.adal.Oauth2.java

public String getAuthorizationEndpointQueryParameters() throws UnsupportedEncodingException {
    String requestUrl = String.format("response_type=%s&client_id=%s&resource=%s&redirect_uri=%s&state=%s",
            AuthenticationConstants.OAuth2.CODE,
            URLEncoder.encode(mRequest.getClientId(), AuthenticationConstants.ENCODING_UTF8),
            URLEncoder.encode(mRequest.getResource(), AuthenticationConstants.ENCODING_UTF8),
            URLEncoder.encode(mRequest.getRedirectUri(), AuthenticationConstants.ENCODING_UTF8),
            encodeProtocolState());/* w  ww  .j  a v  a 2  s . c om*/

    if (mRequest.getLoginHint() != null && !mRequest.getLoginHint().isEmpty()) {
        requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.LOGIN_HINT,
                URLEncoder.encode(mRequest.getLoginHint(), AuthenticationConstants.ENCODING_UTF8));
    }

    requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.ADAL_ID_PLATFORM, "Android");
    requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.ADAL_ID_VERSION,
            URLEncoder.encode(AuthenticationContext.getVersionName(), AuthenticationConstants.ENCODING_UTF8));
    requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.ADAL_ID_OS_VER,
            URLEncoder.encode("" + Build.VERSION.SDK_INT, AuthenticationConstants.ENCODING_UTF8));
    requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.ADAL_ID_DM,
            URLEncoder.encode("" + android.os.Build.MODEL, AuthenticationConstants.ENCODING_UTF8));

    if (mRequest.getCorrelationId() != null) {
        requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.CLIENT_REQUEST_ID,
                URLEncoder.encode(mRequest.getCorrelationId().toString(),
                        AuthenticationConstants.ENCODING_UTF8));
    }

    // Setting prompt behavior to always will skip the cookies for webview.
    // It is added to authorization url.
    if (mRequest.getPrompt() == PromptBehavior.Always) {
        requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.QUERY_PROMPT, URLEncoder
                .encode(AuthenticationConstants.AAD.QUERY_PROMPT_VALUE, AuthenticationConstants.ENCODING_UTF8));
    } else if (mRequest.getPrompt() == PromptBehavior.REFRESH_SESSION) {
        requestUrl = String.format("%s&%s=%s", requestUrl, AuthenticationConstants.AAD.QUERY_PROMPT,
                URLEncoder.encode(AuthenticationConstants.AAD.QUERY_PROMPT_REFRESH_SESSION_VALUE,
                        AuthenticationConstants.ENCODING_UTF8));
    }

    if (!StringExtensions.IsNullOrBlank(mRequest.getExtraQueryParamsAuthentication())) {
        String params = mRequest.getExtraQueryParamsAuthentication();
        if (!params.startsWith("&")) {
            params = "&" + params;
        }
        requestUrl = requestUrl + params;
    }
    return requestUrl;

}

From source file:com.urucas.deskflix.utils.Utils.java

public static String getDeviceName() {
    String manufacturer = Build.MANUFACTURER;
    String model = Build.MODEL;
    if (model.startsWith(manufacturer)) {
        return Utils.capitalize(model);
    } else {/*from   www  .j  a v a2 s .c om*/
        return Utils.capitalize(manufacturer) + " " + model;
    }
}

From source file:org.ciasaboark.tacere.activity.fragment.BugReportDialogFragment.java

@Nullable
@Override//from   ww  w . j  a v a  2s  . c om
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.activity_bug_report, container, false);

    final Spinner spinner = (Spinner) rootView.findViewById(R.id.spinner);
    // Create an ArrayAdapter using the string array and a default spinner layout
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.report_types,
            android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    spinner.setAdapter(adapter);

    Button closeButton = (Button) rootView.findViewById(R.id.bug_report_button_cancel);
    closeButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            BugReportDialogFragment.this.dismiss();
        }
    });

    final Button sendButton = (Button) rootView.findViewById(R.id.bug_report_button_send);
    sendButton.setEnabled(false);
    sendButton.setVisibility(View.INVISIBLE);
    sendButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            sendButton.setEnabled(false);

            final ProgressBar busySpinner = (ProgressBar) rootView.findViewById(R.id.bug_report_progressbar);
            busySpinner.setVisibility(View.VISIBLE);

            EditText messageEditText = (EditText) rootView.findViewById(R.id.bug_report_message);
            final String messageText = messageEditText.getText().toString();

            EditText emailEditText = (EditText) rootView.findViewById(R.id.bug_report_email);
            String emailText = emailEditText.getText().toString();
            final String emailString = emailText.length() == 0 ? "no email address given" : emailText;

            final String spinnerSelection = spinner.getSelectedItem() == null ? "bug"
                    : spinner.getSelectedItem().toString();

            new Thread(new Runnable() {
                @Override
                public void run() {
                    boolean reportSent = false;
                    GitHubClient client = new GitHubClient();
                    client.setOAuth2Token(GitHubKeySet.GITHUB_OAUTH);

                    RepositoryService repositoryService = new RepositoryService(client);
                    try {
                        Repository repository = repositoryService.getRepository("ciasaboark", "Tacere");

                        IssueService issueService = new IssueService();
                        issueService.getClient().setOAuth2Token(GitHubKeySet.GITHUB_OAUTH);
                        Issue issue = new Issue();
                        issue.setTitle("Tacere issue submit");

                        String bodyText = "";
                        bodyText += messageText;
                        bodyText += "\n\nEmail : " + emailString;
                        bodyText += "\nAndroid Version: " + Build.VERSION.RELEASE;
                        bodyText += "\nTacere version: " + Versioning.getVersionCode();
                        bodyText += "\nDevice: " + Build.MANUFACTURER + " - " + Build.MODEL;
                        bodyText += "\nRom: " + Build.DISPLAY;

                        issue.setBody(bodyText);

                        Label label = new Label();
                        label.setName("autosubmit");
                        List<Label> labels = new ArrayList<Label>();
                        labels.add(label);

                        String reportTypeLabel;
                        switch (spinnerSelection.toLowerCase()) {
                        case "bug":
                            reportTypeLabel = "bug";
                            break;
                        case "wishlist":
                            reportTypeLabel = "wishlist";
                            break;
                        default:
                            Log.w(TAG, "unknown reportType " + spinnerSelection + ", assuming to "
                                    + "be a bug report");
                            reportTypeLabel = "bug";
                        }

                        Label reportLabel = new Label();
                        reportLabel.setName(reportTypeLabel);
                        labels.add(reportLabel);
                        issue.setLabels(labels);

                        UserService userService = new UserService(client);
                        User user = userService.getUser("ciasaboark");
                        issue.setAssignee(user);

                        try {
                            issueService.createIssue(repository, issue);
                            reportSent = true;
                        } catch (IOException e) {
                            Log.e(TAG, "unable to create issue in repository");
                        }

                    } catch (IOException e) {
                        Log.e(TAG, "unable to get list of user repositories");
                    }

                    if (reportSent) {
                        getActivity().runOnUiThread(new Runnable() {
                            public void run() {
                                Toast.makeText(getActivity(), R.string.bug_report_toast_sent, Toast.LENGTH_LONG)
                                        .show();
                                BugReportDialogFragment.this.dismiss();

                            }
                        });
                    } else {
                        getActivity().runOnUiThread(new Runnable() {
                            public void run() {
                                Toast.makeText(getActivity(), R.string.bug_report_toast_failed,
                                        Toast.LENGTH_LONG).show();
                                busySpinner.setVisibility(View.INVISIBLE);
                                sendButton.setEnabled(true);
                                sendButton.setVisibility(View.VISIBLE);
                            }
                        });
                    }
                }
            }).start();

        }
    });

    EditText messageEditText = (EditText) rootView.findViewById(R.id.bug_report_message);
    messageEditText.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            //nothing to do here
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            //nothing to do here
        }

        @Override
        public void afterTextChanged(Editable s) {
            if (s.length() > 0) {
                sendButton.setVisibility(View.VISIBLE);
                sendButton.setEnabled(true);
            } else {
                sendButton.setVisibility(View.INVISIBLE);
                sendButton.setEnabled(false);
            }
        }
    });

    return rootView;
}

From source file:mobisocial.metrics.MusubiExceptionHandler.java

static JSONObject jsonForException(Context context, Throwable ex, boolean caught) {
    JSONObject json = new JSONObject();
    try {/*from   w w  w  .  j  a v  a 2 s  .c o  m*/
        Writer traceWriter = new StringWriter();
        PrintWriter printer = new PrintWriter(traceWriter);
        ex.printStackTrace(printer);
        json.put("type", "exception");
        json.put("caught", caught);
        json.put("app", context.getPackageName());
        json.put("message", ex.getMessage());
        json.put("trace", traceWriter.toString());
        json.put("timestamp", Long.toString(new Date().getTime()));

        boolean devmode = MusubiBaseActivity.isDeveloperModeEnabled(context);
        json.put("musubi_devmode", Boolean.toString(devmode));
        if (devmode) {
            IdentitiesManager im = new IdentitiesManager(App.getDatabaseSource(context));
            MIdentity id = im.getMyDefaultIdentity();
            String user = "Unknown";
            if (id != null) {
                user = UiUtil.safeNameForIdentity(id);
            }
            json.put("musubi_devmode_user_id", user);
            user = App.getMusubi(context).userForLocalDevice(null).getName();
            json.put("musubi_devmode_user_name", user);
        }
        try {
            PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
            json.put("musubi_version_name", info.versionName);
            json.put("musubi_version_code", Integer.toString(info.versionCode));
        } catch (NameNotFoundException e) {
            // shouldn't happen, but not fatal.
        }
        json.put("android_api", Integer.toString(Build.VERSION.SDK_INT));
        json.put("android_release", Build.VERSION.RELEASE);
        json.put("android_model", Build.MODEL);
        json.put("android_make", Build.MANUFACTURER);
    } catch (JSONException e) {
    }
    return json;
}

From source file:org.noise_planet.noisecapture.MeasurementExport.java

/**
 * Dump measurement into the specified writer
 * @param recordId Record identifier/*w w w .  j av a2 s  .c  om*/
 * @param outputStream Data output target
 * @throws IOException output error
 */
public void exportRecord(int recordId, OutputStream outputStream, boolean exportReadme) throws IOException {
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
    ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
    Storage.Record record = measurementManager.getRecord(recordId);

    // Property file
    Properties properties = new Properties();
    String versionName = "NONE";
    int versionCode = -1;
    try {
        PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
        versionName = packageInfo.versionName;
        versionCode = packageInfo.versionCode;
    } catch (PackageManager.NameNotFoundException ex) {
        LOGGER.error(ex.getLocalizedMessage(), ex);
    }
    properties.setProperty(PROP_VERSION_NAME, versionName);
    properties.setProperty(PROP_BUILD_TIME, String.valueOf(BuildConfig.TIMESTAMP));
    properties.setProperty(PROP_VERSION_INT, String.valueOf(versionCode));
    properties.setProperty(PROP_MANUFACTURER, Build.MANUFACTURER);
    properties.setProperty(PROP_PRODUCT, Build.PRODUCT);
    properties.setProperty(PROP_MODEL, Build.MODEL);
    properties.setProperty(PROP_UUID, sharedPref.getString(PROP_UUID, ""));
    properties.setProperty(Storage.Record.COLUMN_UTC, String.valueOf(record.getUtc()));
    properties.setProperty(Storage.Record.COLUMN_LEQ_MEAN,
            String.format(Locale.US, "%.02f", record.getLeqMean()));
    properties.setProperty(PROP_GAIN_CALIBRATION,
            String.format(Locale.US, "%.02f", record.getCalibrationGain()));
    properties.setProperty(Storage.Record.COLUMN_TIME_LENGTH, String.valueOf(record.getTimeLength()));
    if (record.getPleasantness() != null) {
        properties.setProperty(Storage.Record.COLUMN_PLEASANTNESS, String.valueOf(record.getPleasantness()));
    }
    List<String> tags = measurementManager.getTags(recordId);
    StringBuilder tagsString = new StringBuilder();
    for (String tag : tags) {
        if (tagsString.length() != 0) {
            tagsString.append(",");
        }
        tagsString.append(tag);
    }
    properties.setProperty(PROP_TAGS, tagsString.toString());
    zipOutputStream.putNextEntry(new ZipEntry(PROPERTY_FILENAME));
    properties.store(zipOutputStream, "NoiseCapture export header file");
    zipOutputStream.closeEntry();

    // GeoJSON file

    List<MeasurementManager.LeqBatch> records = measurementManager.getRecordLocations(recordId, false);
    // If Memory problems switch to JSONWriter
    JSONObject main = new JSONObject();

    try {
        // Add CRS
        JSONObject crs = new JSONObject();
        JSONObject crsProperty = new JSONObject();
        crsProperty.put("name", "urn:ogc:def:crs:OGC:1.3:CRS84");
        crs.put("type", "name");
        crs.put("properties", crsProperty);
        main.put("crs", crs);

        // Add measures
        main.put("type", "FeatureCollection");
        List<JSONObject> features = new ArrayList<>(records.size());
        for (MeasurementManager.LeqBatch entry : records) {
            Storage.Leq leq = entry.getLeq();
            JSONObject feature = new JSONObject();
            feature.put("type", "Feature");

            if (leq.getAccuracy() > 0) {
                // Add coordinate
                JSONObject point = new JSONObject();
                point.put("type", "Point");
                point.put("coordinates",
                        new JSONArray(Arrays.asList(leq.getLongitude(), leq.getLatitude(), leq.getAltitude())));
                feature.put("geometry", point);
            } else {
                feature.put("geometry", JSONObject.NULL);
            }

            // Add properties
            JSONObject featureProperties = new JSONObject();
            featureProperties.put(Storage.Record.COLUMN_LEQ_MEAN, entry.computeGlobalLeq());
            featureProperties.put(Storage.Leq.COLUMN_ACCURACY, leq.getAccuracy());
            featureProperties.put(Storage.Leq.COLUMN_LOCATION_UTC, leq.getLocationUTC());
            featureProperties.put(Storage.Leq.COLUMN_LEQ_UTC, leq.getLeqUtc());
            featureProperties.put(Storage.Leq.COLUMN_LEQ_ID, leq.getLeqId());
            //marker-color tag for geojson.io
            featureProperties.put("marker-color", String.format("#%06X",
                    (0xFFFFFF & Spectrogram.getColor((float) entry.computeGlobalLeq(), 45, 100))));
            if (leq.getBearing() != null) {
                featureProperties.put(Storage.Leq.COLUMN_BEARING, leq.getBearing());
            }
            if (leq.getSpeed() != null) {
                featureProperties.put(Storage.Leq.COLUMN_SPEED, leq.getSpeed());
            }
            for (Storage.LeqValue leqValue : entry.getLeqValues()) {
                featureProperties.put("leq_" + leqValue.getFrequency(), leqValue.getSpl());
            }
            feature.put("properties", featureProperties);
            features.add(feature);
        }
        main.put("features", new JSONArray(features));
        zipOutputStream.putNextEntry(new ZipEntry(GEOJSON_FILENAME));
        Writer writer = new OutputStreamWriter(zipOutputStream);
        writer.write(main.toString(2));
        writer.flush();
        zipOutputStream.closeEntry();

        if (exportReadme) {
            // Readme file
            zipOutputStream.putNextEntry(new ZipEntry(README_FILENAME));
            writer = new OutputStreamWriter(zipOutputStream);
            writer.write(context.getString(R.string.export_zip_info));
            writer.flush();
            zipOutputStream.closeEntry();
        }
    } catch (JSONException ex) {
        throw new IOException(ex);
    } finally {
        zipOutputStream.finish();
    }
}

From source file:net.mypapit.mobile.callsignview.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    activity = this;

    overridePendingTransition(R.anim.activity_open_translate, R.anim.activity_close_scale);

    SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
    mSearchHandle = prefs.getBoolean("mSearchHandle", false);

    lv = (ListView) this.findViewById(R.id.listView);
    new LoadDatabaseTask(this).execute("load database");

    lv.setOnItemClickListener(new OnItemClickListener() {
        @Override/*from   ww w . java  2 s . c o  m*/
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Intent passIntent = new Intent(getApplicationContext(), CallsignDetailActivity.class);
            Cursor cursor1 = (Cursor) lv.getItemAtPosition(position);
            Callsign cs = new Callsign(cursor1.getString(cursor1.getColumnIndex("callsign")),
                    cursor1.getString(cursor1.getColumnIndex("handle")));
            cs.setAa(cursor1.getString(cursor1.getColumnIndex("aa")));
            cs.setExpire(cursor1.getString(cursor1.getColumnIndex("expire")));

            OkHttpClient client = new OkHttpClient();

            RequestBody formbody = new FormBody.Builder().add("apiver", "1").add("callsign", cs.getCallsign())
                    .add("device", Build.PRODUCT + " " + Build.MODEL).add("client", CLIENT_VERSION).build();
            Request request = new Request.Builder().url("http://api.repeater.my/v1/callsign/endp.php")
                    .post(formbody).build();

            client.newCall(request).enqueue(new Callback() {
                @Override
                public void onFailure(Call call, IOException e) {
                    Log.d("OKHttp", e.getMessage());
                    e.printStackTrace();
                }

                @Override
                public void onResponse(Call call, Response response) throws IOException {
                    System.out.println(response.body().string());

                }
            });

            ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity,
                    (View) view, "profile");

            passIntent.putExtra("Callsign", cs);

            startActivityForResult(passIntent, -1, options.toBundle());

        }
    });

}

From source file:com.bearstouch.android.core.InstallTracker.java

public void trackInstall(Activity activity, String app_name, String app_version_name) {

    mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, APP_NAME_VAR, app_name, 1);
    mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, APP_VERSION_VAR, app_version_name, 1);
    mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, SDK_VERSION_VAR, Integer.toString(Build.VERSION.SDK_INT), 1);
    mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, PHONE_VAR,
            Build.MANUFACTURER + " " + Build.PRODUCT + " " + Build.MODEL, 1);
    mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, CPU_VAR, Build.CPU_ABI, 1);
    String installationSource = mContext.getPackageManager().getInstallerPackageName(mContext.getPackageName());
    mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, INSTALLER_VAR, installationSource, 1);

    // Ecra/*from  www.  j a v  a2 s  .  co m*/
    DisplayMetrics displayMetrics = AndroidUtil.getDisplayMetrics(activity);
    if (displayMetrics != null) {
        String Resolution = displayMetrics.widthPixels + "x" + displayMetrics.heightPixels;
        String dpis = displayMetrics.xdpi + "x" + displayMetrics.ydpi;
        mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, "RESOLUTION", Resolution, 1);
        mGTracker.trackEvent(INSTALL_TRACK_EVENT_TAG, "DPI", dpis, 1);
    }
}

From source file:om.sstvencoder.MainActivity.java

private void showErrorMessage(final String title, final String shortText, final String longText) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(title);// w  w  w  .  java 2s.co  m
    builder.setMessage(shortText);
    builder.setNeutralButton(getString(R.string.btn_ok), null);
    builder.setPositiveButton(getString(R.string.btn_send_email), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            String device = Build.MANUFACTURER + ", " + Build.BRAND + ", " + Build.MODEL + ", "
                    + Build.VERSION.RELEASE;
            String text = longText + "\n\n" + BuildConfig.VERSION_NAME + ", " + device;
            Intent intent = Utility.createEmailIntent(getString(R.string.email_subject), text);
            startActivity(Intent.createChooser(intent, getString(R.string.chooser_title)));
        }
    });
    builder.show();
}

From source file:air.com.snagfilms.utils.Utils.java

public static String getDeviceParameters(Context ctx) {

    StringBuilder strBlr = null;/*w  ww .  j av a2  s.  c o  m*/

    String device_id = Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID);
    String PhoneModel = android.os.Build.MODEL;

    strBlr = new StringBuilder();
    strBlr.append(Constants.DEVICE_ID);
    strBlr.append("=");
    strBlr.append(device_id);

    strBlr.append("&");
    strBlr.append(Constants.DEVICE_MODEL);
    strBlr.append("=");
    strBlr.append(PhoneModel);

    return strBlr.toString();
}

From source file:com.android.tv.settings.about.AboutFragment.java

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    setPreferencesFromResource(R.xml.device_info_settings, null);
    final PreferenceScreen screen = getPreferenceScreen();

    refreshDeviceName();/*from  ww  w .  jav a 2 s. c  om*/
    final Preference deviceNamePref = findPreference(KEY_DEVICE_NAME);
    PreferenceUtils.resolveSystemActivityOrRemove(getActivity(), screen, deviceNamePref, 0);

    final Preference firmwareVersionPref = findPreference(KEY_FIRMWARE_VERSION);
    firmwareVersionPref.setSummary(Build.VERSION.RELEASE);
    firmwareVersionPref.setEnabled(true);

    final Preference securityPatchPref = findPreference(KEY_SECURITY_PATCH);
    final String patch = DeviceInfoUtils.getSecurityPatch();
    if (!TextUtils.isEmpty(patch)) {
        securityPatchPref.setSummary(patch);
    } else {
        removePreference(securityPatchPref);
    }

    final LongClickPreference restartPref = (LongClickPreference) findPreference(KEY_RESTART);
    restartPref.setLongClickListener(this);

    findPreference(KEY_BASEBAND_VERSION)
            .setSummary(getSystemPropertySummary(TelephonyProperties.PROPERTY_BASEBAND_VERSION));
    findPreference(KEY_DEVICE_MODEL).setSummary(Build.MODEL + DeviceInfoUtils.getMsvSuffix());
    findPreference(KEY_EQUIPMENT_ID).setSummary(getSystemPropertySummary(PROPERTY_EQUIPMENT_ID));

    final Preference buildNumberPref = findPreference(KEY_BUILD_NUMBER);
    buildNumberPref.setSummary(Build.DISPLAY);
    buildNumberPref.setEnabled(true);
    findPreference(KEY_KERNEL_VERSION).setSummary(DeviceInfoUtils.getFormattedKernelVersion());

    final Preference selinuxPref = findPreference(KEY_SELINUX_STATUS);
    if (!SELinux.isSELinuxEnabled()) {
        selinuxPref.setSummary(R.string.selinux_status_disabled);
    } else if (!SELinux.isSELinuxEnforced()) {
        selinuxPref.setSummary(R.string.selinux_status_permissive);
    }

    // Remove selinux information if property is not present
    if (TextUtils.isEmpty(SystemProperties.get(PROPERTY_SELINUX_STATUS))) {
        removePreference(selinuxPref);
    }

    // Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
    if (TextUtils.isEmpty(SystemProperties.get(PROPERTY_URL_SAFETYLEGAL))) {
        removePreference(findPreference(KEY_SAFETY_LEGAL));
    }

    // Remove Equipment id preference if FCC ID is not set by RIL
    if (TextUtils.isEmpty(SystemProperties.get(PROPERTY_EQUIPMENT_ID))) {
        removePreference(findPreference(KEY_EQUIPMENT_ID));
    }

    // Remove Baseband version if wifi-only device
    if (isWifiOnly(getActivity())) {
        removePreference(findPreference(KEY_BASEBAND_VERSION));
    }

    // Dont show feedback option if there is no reporter.
    if (TextUtils.isEmpty(DeviceInfoUtils.getFeedbackReporterPackage(getActivity()))) {
        removePreference(findPreference(KEY_DEVICE_FEEDBACK));
    }

    final Preference updateSettingsPref = findPreference(KEY_SYSTEM_UPDATE_SETTINGS);
    if (mUm.isAdminUser()) {
        PreferenceUtils.resolveSystemActivityOrRemove(getActivity(), screen, updateSettingsPref,
                PreferenceUtils.FLAG_SET_TITLE);
    } else if (updateSettingsPref != null) {
        // Remove for secondary users
        removePreference(updateSettingsPref);
    }

    // Read platform settings for additional system update setting
    if (!getResources().getBoolean(R.bool.config_additional_system_update_setting_enable)) {
        removePreference(findPreference(KEY_UPDATE_SETTING));
    }

    // Remove manual entry if none present.
    if (!getResources().getBoolean(R.bool.config_show_manual)) {
        removePreference(findPreference(KEY_MANUAL));
    }

    // Remove regulatory information if none present.
    final Preference regulatoryPref = findPreference(KEY_REGULATORY_INFO);
    PreferenceUtils.resolveSystemActivityOrRemove(getActivity(), screen, regulatoryPref, 0);
}