android.os.Build#DISPLAY源码实例Demo

下面列出了android.os.Build#DISPLAY 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: PictureSelector   文件: CropRomUtils.java
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;
}
 
源代码2 项目: webrtc_android   文件: RomUtil.java
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);
}
 
源代码3 项目: FriendCircle   文件: OSUtils.java
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);
}
 
源代码4 项目: DevUtils   文件: ROMUtils.java
/**
 * 获取 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;
}
 
源代码5 项目: Common   文件: RomUtils.java
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;
}
 
源代码6 项目: AndroidUtilCode   文件: RomUtils.java
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;
}
 
源代码7 项目: NIM_Android_UIKit   文件: CaptureVideoActivity.java
@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);
    }
}
 
源代码8 项目: pre-dem-android   文件: AppBean.java
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);
}
 
源代码9 项目: Alite   文件: AliteLog.java
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";

}
 
源代码10 项目: 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);
    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);
}
 
源代码11 项目: XPrivacy   文件: Hook.java
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;
}
 
源代码12 项目: Box   文件: DeviceUtils.java
public static String getDisplay() {
    return Build.DISPLAY;
}
 
源代码13 项目: KernelAdiutor   文件: Device.java
public static String getBuildDisplayId() {
    return Build.DISPLAY;
}
 
源代码14 项目: MTweaks-KernelAdiutorMOD   文件: Device.java
public static String getBuildDisplayId() {
    return Build.DISPLAY;
}
 
源代码15 项目: XposedHider   文件: Crashlytics.java
@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);
}
 
源代码16 项目: react-native-device-info   文件: RNDeviceModule.java
@ReactMethod(isBlockingSynchronousMethod = true)
public String getDisplaySync() { return Build.DISPLAY; }
 
源代码17 项目: UIWidget   文件: RomUtil.java
/**
 * 获取Flyme的版本
 *
 * @return
 */
public static String getFlymeVersion() {
    return isFlyme() ? Build.DISPLAY : "";
}
 
源代码18 项目: Android-utils   文件: DeviceUtils.java
/**
 * 获取系统版本号
 *
 * @return 系统版本号
 */
public static String getDisplay() {
    return Build.DISPLAY;
}
 
源代码19 项目: DevUtils   文件: DeviceUtils.java
/**
 * 获取设备显示的版本包 ( 在系统设置中显示为版本号 ) 和 ID 一样
 * @return 设备显示的版本包
 */
public static String getDisplay() {
    return Build.DISPLAY;
}
 
源代码20 项目: TitleBarView   文件: RomUtil.java
/**
 * 获取Flyme的版本
 *
 * @return
 */
public static String getFlymeVersion() {
    return isFlyme() ? Build.DISPLAY : "";
}