Java Code Examples for android.os.Build#DISPLAY

The following examples show how to use android.os.Build#DISPLAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CropRomUtils.java    From PictureSelector with Apache License 2.0 6 votes vote down vote up
public static int getFlymeVersion() {
    String displayId = Build.DISPLAY;
    if (!TextUtils.isEmpty(displayId) && displayId.contains("Flyme")) {
        displayId = displayId.replaceAll("Flyme", "");
        displayId = displayId.replaceAll("OS", "");
        displayId = displayId.replaceAll(" ", "");


        String version = displayId.substring(0, 1);

        if (version != null) {
            return stringToInt(version);
        }
    }
    return 0;
}
 
Example 2
Source File: RomUtils.java    From AndroidUtilCode with Apache License 2.0 6 votes vote down vote up
private static String getRomVersion(final String propertyName) {
    String ret = "";
    if (!TextUtils.isEmpty(propertyName)) {
        ret = getSystemProperty(propertyName);
    }
    if (TextUtils.isEmpty(ret) || ret.equals(UNKNOWN)) {
        try {
            String display = Build.DISPLAY;
            if (!TextUtils.isEmpty(display)) {
                ret = display.toLowerCase();
            }
        } catch (Throwable ignore) {/**/}
    }
    if (TextUtils.isEmpty(ret)) {
        return UNKNOWN;
    }
    return ret;
}
 
Example 3
Source File: RomUtils.java    From Common with Apache License 2.0 6 votes vote down vote up
private static String getRomVersion(final String propertyName) {
    String ret = "";
    if (!TextUtils.isEmpty(propertyName)) {
        ret = getSystemProperty(propertyName);
    }
    if (TextUtils.isEmpty(ret) || ret.equals(UNKNOWN)) {
        try {
            String display = Build.DISPLAY;
            if (!TextUtils.isEmpty(display)) {
                ret = display.toLowerCase();
            }
        } catch (Throwable ignore) {/**/}
    }
    if (TextUtils.isEmpty(ret)) {
        return UNKNOWN;
    }
    return ret;
}
 
Example 4
Source File: ROMUtils.java    From DevUtils with Apache License 2.0 6 votes vote down vote up
/**
 * 获取 ROM 版本信息
 * @param propertyName 属性名
 * @return ROM 版本信息
 */
private static String getRomVersion(final String propertyName) {
    String ret = "";
    if (!TextUtils.isEmpty(propertyName)) {
        ret = getSystemProperty(propertyName);
    }
    if (TextUtils.isEmpty(ret) || ret.equals(UNKNOWN)) {
        try {
            String display = Build.DISPLAY;
            if (!TextUtils.isEmpty(display)) {
                ret = display.toLowerCase();
            }
        } catch (Throwable ignore) {
        }
    }
    if (TextUtils.isEmpty(ret)) {
        return UNKNOWN;
    }
    return ret;
}
 
Example 5
Source File: OSUtils.java    From FriendCircle with GNU General Public License v3.0 6 votes vote down vote up
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    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);
}
 
Example 6
Source File: RomUtil.java    From webrtc_android with MIT License 6 votes vote down vote up
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    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);
}
 
Example 7
Source File: CaptureVideoActivity.java    From NIM_Android_UIKit with MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void setCamcorderProfile() {
    CamcorderProfile profile;
    profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
    if (profile != null) {
        if (currentUsePoint != null) {
            profile.videoFrameWidth = currentUsePoint.x;
            profile.videoFrameHeight = currentUsePoint.y;
        }
        profile.fileFormat = MediaRecorder.OutputFormat.MPEG_4;
        if (Build.MODEL.equalsIgnoreCase("MB525") || Build.MODEL.equalsIgnoreCase("C8812") ||
            Build.MODEL.equalsIgnoreCase("C8650")) {
            profile.videoCodec = MediaRecorder.VideoEncoder.H263;
        } else {
            profile.videoCodec = MediaRecorder.VideoEncoder.H264;
        }
        if (Build.VERSION.SDK_INT >= 14) {
            profile.audioCodec = MediaRecorder.AudioEncoder.AAC;
        } else {
            if (Build.DISPLAY != null && Build.DISPLAY.indexOf("MIUI") >= 0) {
                profile.audioCodec = MediaRecorder.AudioEncoder.AAC;
            } else {
                profile.audioCodec = MediaRecorder.AudioEncoder.AMR_NB;
            }
        }
        mediaRecorder.setProfile(profile);
    } else {
        mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
        mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        mediaRecorder.setVideoSize(VIDEO_WIDTH, VIDEO_HEIGHT);
    }
}
 
Example 8
Source File: AppBean.java    From pre-dem-android with MIT License 5 votes vote down vote up
public static void loadFromContext(Context context) {
    APP_NAME = getAppName(context);
    ANDROID_VERSION = Build.VERSION.RELEASE;
    ANDROID_BUILD = Build.DISPLAY;
    PHONE_MODEL = Build.MODEL;
    PHONE_MANUFACTURER = Build.MANUFACTURER;

    SDK_ID = Functions.getSdkId();

    loadPackageData(context);
    loadCrashIdentifier(context);
}
 
Example 9
Source File: AliteLog.java    From Alite with GNU General Public License v3.0 5 votes vote down vote up
public static String getDeviceInfo() {
	return "Android version: " + Build.VERSION.RELEASE + "\n" +
              "Device: " + Build.DEVICE + "\n" +
           "Product: " + Build.PRODUCT + "\n" +
              "Brand: " + Build.BRAND + "\n" +
           "Display: " + Build.DISPLAY + "\n" +
              "Manufacturer: " + Build.MANUFACTURER + "\n" +
           "Model: " + Build.MODEL + "\n";

}
 
Example 10
Source File: AboutFragment.java    From walt with Apache License 2.0 5 votes vote down vote up
@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);
    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);
}
 
Example 11
Source File: Hook.java    From XPrivacy with GNU General Public License v3.0 5 votes vote down vote up
public static boolean isAOSP(int sdk) {
	if (!PrivacyManager.cVersion3)
		return false;
	if (Build.VERSION.SDK_INT >= sdk) {
		if ("true".equals(System.getenv("XPrivacy.AOSP")))
			return true;
		if (Build.DISPLAY == null || Build.HOST == null)
			return false;
		if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
			// @formatter:off
			return (
					isAOSP() ||
					isCyanogenMod() ||
					isOmni() ||
					isMIUI() ||
					isSlim() ||
					isParanoidAndroid() ||
					isCarbon() ||
					isDirtyUnicorns() ||
					isLiquidSmooth() ||
					isAndroidRevolutionHD() ||
					isMahdi() ||
					isOmega()
				);
		// @formatter:on
		else
			return isAOSP();
	} else
		return false;
}
 
Example 12
Source File: Device.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static String getBuildDisplayId() {
    return Build.DISPLAY;
}
 
Example 13
Source File: Device.java    From MTweaks-KernelAdiutorMOD with GNU General Public License v3.0 4 votes vote down vote up
public static String getBuildDisplayId() {
    return Build.DISPLAY;
}
 
Example 14
Source File: Crashlytics.java    From XposedHider with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void uncaughtException(Thread t, Throwable e) {
    e.printStackTrace();
    String crashTime =
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault())
                    .format(new Date());
    String env =
            "########RuntimeEnviormentInormation#######\n" +
                    "crashTime = " + crashTime + "\n" +
                    "model = " + Build.MODEL + "\n" +
                    "android = " + Build.VERSION.RELEASE + "(" + Build.VERSION.SDK_INT + ")\n" +
                    "brand = " + Build.BRAND + "\n" +
                    "manufacturer = " + Build.MANUFACTURER + "\n" +
                    "board = " + Build.BOARD + "\n" +
                    "hardware = " + Build.HARDWARE + "\n" +
                    "device = " + Build.DEVICE + "\n" +
                    "version = " + getVersionName() + "(" + getVersionCode() + ")\n" +
                    "supportAbis = " + getSupportAbis() + "\n" +
                    "display = " + Build.DISPLAY + "\n";
    Writer writer = new StringWriter();
    PrintWriter printWriter = new PrintWriter(writer);
    e.printStackTrace(printWriter);
    Throwable cause = e.getCause();
    while (cause != null) {
        cause.printStackTrace(printWriter);
        cause = cause.getCause();
    }
    printWriter.close();
    String stack = "############ForceCloseCrashLog############\n" + writer.toString();
    String message = env + stack;
    try {
        String name = "error_log_" + crashTime + ".log";
        FileOutputStream fos =
                new FileOutputStream(new File(mContext.getExternalFilesDir("logs"), name));
        fos.write(message.getBytes());
        fos.close();
    } catch (IOException ex) {
        ex.printStackTrace();
    }

    Process.killProcess(Process.myPid());
    System.exit(1);
}
 
Example 15
Source File: DeviceUtils.java    From Box with Apache License 2.0 4 votes vote down vote up
public static String getDisplay() {
    return Build.DISPLAY;
}
 
Example 16
Source File: RNDeviceModule.java    From react-native-device-info with MIT License 4 votes vote down vote up
@ReactMethod(isBlockingSynchronousMethod = true)
public String getDisplaySync() { return Build.DISPLAY; }
 
Example 17
Source File: DeviceUtils.java    From Android-utils with Apache License 2.0 2 votes vote down vote up
/**
 * 获取系统版本号
 *
 * @return 系统版本号
 */
public static String getDisplay() {
    return Build.DISPLAY;
}
 
Example 18
Source File: RomUtil.java    From UIWidget with Apache License 2.0 2 votes vote down vote up
/**
 * 获取Flyme的版本
 *
 * @return
 */
public static String getFlymeVersion() {
    return isFlyme() ? Build.DISPLAY : "";
}
 
Example 19
Source File: DeviceUtils.java    From DevUtils with Apache License 2.0 2 votes vote down vote up
/**
 * 获取设备显示的版本包 ( 在系统设置中显示为版本号 ) 和 ID 一样
 * @return 设备显示的版本包
 */
public static String getDisplay() {
    return Build.DISPLAY;
}
 
Example 20
Source File: RomUtil.java    From TitleBarView with Apache License 2.0 2 votes vote down vote up
/**
 * 获取Flyme的版本
 *
 * @return
 */
public static String getFlymeVersion() {
    return isFlyme() ? Build.DISPLAY : "";
}