本文整理汇总了Java中android.os.Build.BRAND属性的典型用法代码示例。如果您正苦于以下问题:Java Build.BRAND属性的具体用法?Java Build.BRAND怎么用?Java Build.BRAND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.os.Build
的用法示例。
在下文中一共展示了Build.BRAND属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateSignature
public boolean validateSignature(Context context, String packageName) {
String brand = Build.BRAND;
int applicationFlags = context.getApplicationInfo().flags;
if (brand.startsWith("generic") &&
(applicationFlags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// We are debugging on an emulator, don't validate package signature.
return true;
}
PackageInfo packageInfo = null;
try {
packageInfo = context.getPackageManager().getPackageInfo(packageName,
PackageManager.GET_SIGNATURES);
} catch (PackageManager.NameNotFoundException e) {
return false;
}
for (Signature signature : packageInfo.signatures) {
String hashedSignature = Utility.sha1hash(signature.toByteArray());
if (validAppSignatureHashes.contains(hashedSignature)) {
return true;
}
}
return false;
}
示例2: sendFeedback
public static void sendFeedback(Context context) {
String body = null;
try {
body = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
body = "\n\n-----------------------------\nPlease don't remove this information\n Device OS: Android \n Device OS version: " +
Build.VERSION.RELEASE + "\n App Version: " + body + "\n Device Brand: " + Build.BRAND +
"\n Device Model: " + Build.MODEL + "\n Device Manufacturer: " + Build.MANUFACTURER;
} catch (PackageManager.NameNotFoundException e) {
}
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
intent.putExtra(Intent.EXTRA_SUBJECT, "发送自你的安卓设备");
intent.putExtra(Intent.EXTRA_TEXT, body);
context.startActivity(Intent.createChooser(intent, context.getString(R.string.choose_email_client)));
}
示例3: deviceInf
public static void deviceInf(Context ctx) {
String deviceInfo = "Device Info:";
deviceInfo += "\n Android Version: " + Build.VERSION.RELEASE;
deviceInfo += "\n OS API Level: " + android.os.Build.VERSION.SDK_INT;
deviceInfo += "\n OS Version: " + System.getProperty("os.version") + "(" + android.os.Build.VERSION.INCREMENTAL + ")";
deviceInfo += "\n Device: " + android.os.Build.DEVICE;
deviceInfo += "\n Model (and Product): " + android.os.Build.MODEL + " (" + android.os.Build.PRODUCT + ")";
deviceInfo += "\n Model manufacturer:" + Build.BRAND;
deviceInfo += "\n Model Hardware:" +Build.HARDWARE;
PackageInfo pinfo = null;
try {
pinfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e1) {
e1.printStackTrace();
}
int versionNumber = pinfo.versionCode;
String versionName = pinfo.versionName;
deviceInfo +="\n App Version : " + versionName + versionNumber;
deviceInfo += "\n Root Status:" +isRooted();
String locale = ctx.getResources().getConfiguration().locale.getCountry();
deviceInfo += "\n Country:" + locale;
Intent email = new Intent(Intent.ACTION_SEND);
String emailID = emailaddress();
email.putExtra(Intent.EXTRA_EMAIL, new String[]{emailID});
email.putExtra(Intent.EXTRA_SUBJECT, ctx.getPackageName() + " Feedback /Bug Report");
email.setType("message/rfc822");
email.putExtra(Intent.EXTRA_TEXT, "\n\n\n" + deviceInfo);
Intent new_intent = Intent.createChooser(email, "Email Via...");
new_intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.startActivity(new_intent);
}
示例4: validateSignature
public boolean validateSignature(Context context, String packageName) {
String brand = Build.BRAND;
int applicationFlags = context.getApplicationInfo().flags;
if (brand.startsWith("generic") && (applicationFlags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// We are debugging on an emulator, don't validate package signature.
return true;
}
PackageInfo packageInfo = null;
try {
packageInfo = context.getPackageManager().getPackageInfo(packageName,
PackageManager.GET_SIGNATURES);
} catch (PackageManager.NameNotFoundException e) {
return false;
}
for (Signature signature : packageInfo.signatures) {
String hashedSignature = Utility.sha1hash(signature.toByteArray());
if (validAppSignatureHashes.contains(hashedSignature)) {
return true;
}
}
return false;
}
示例5: getHandSetInfo
private static String getHandSetInfo() {
String handSetInfo = "手机型号:" + Build.MODEL
+ "\n系统版本:" + Build.VERSION.RELEASE
+ "\n产品型号:" + Build.PRODUCT
+ "\n版本显示:" + Build.DISPLAY
+ "\n系统定制商:" + Build.BRAND
+ "\n设备参数:" + Build.DEVICE
+ "\n开发代号:" + Build.VERSION.CODENAME
+ "\nSDK版本号:" + Build.VERSION.SDK_INT
+ "\nCPU类型:" + Build.CPU_ABI
+ "\n硬件类型:" + Build.HARDWARE
+ "\n主机:" + Build.HOST
+ "\n生产ID:" + Build.ID
+ "\nROM制造商:" + Build.MANUFACTURER // 这行返回的是rom定制商的名称
;
Log.e("tt",handSetInfo);
return handSetInfo;
}
示例6: getDeviceListing
/**
*
* @return all involved Build.* parameters and its values
*/
public static String getDeviceListing() {
return "Build.PRODUCT: " + Build.PRODUCT + "\n" +
"Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
"Build.BRAND: " + Build.BRAND + "\n" +
"Build.DEVICE: " + Build.DEVICE + "\n" +
"Build.MODEL: " + Build.MODEL + "\n" +
"Build.HARDWARE: " + Build.HARDWARE + "\n" +
"Build.FINGERPRINT: " + Build.FINGERPRINT + "\n" +
"Build.CPU_ABI: " + Build.CPU_ABI + "\n" +
"Build.CPU_ABI2: " + Build.CPU_ABI2 + "\n" +
"Build.HOST: " + Build.HOST;
}
示例7: convert
public static String convert(@NonNull String requestId) {
SpeechConfig message = new SpeechConfig();
System system = new System();
// This sample does not use Speech SDK, but this value is needed, so set fixed value;
system.version = "2.0.12341";
Os os = new Os();
os.platform = "Android";
os.name = Build.VERSION.CODENAME;
os.version = String.valueOf(Build.VERSION.SDK_INT);
Device device = new Device();
device.manufacturer = Build.BRAND;
device.model = Build.DEVICE;
device.version = Build.VERSION.RELEASE;
message.context.system = system;
message.os = os;
message.device = device;
String json = JsonMapper.toJson(message);
return PATH.getValue() + ": " + SPEECH_CONFIG.getValue() + CRLF.getValue() +
X_REQUEST_ID.getValue() + ": " + requestId + CRLF.getValue() +
X_TIMESTAMP.getValue() + ": " + CurrentTime.newTime() + CRLF.getValue() +
CONTENT_TYPE.getValue() + ": " + APPLICATION_JSON.getValue() + CRLF.getValue() + CRLF.getValue() + json;
}
示例8: getDeviceInfo
/**
* 获取设备信息
*/
public String getDeviceInfo(Context context) {
return getEmulatorName(context) + "\n" + "Build.PRODUCT: " + Build.PRODUCT + "\n" +
"Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
"Build.BRAND: " + Build.BRAND + "\n" +
"Build.DEVICE: " + Build.DEVICE + "\n" +
"Build.MODEL: " + Build.MODEL + "\n" +
"Build.HARDWARE: " + Build.HARDWARE + "\n" +
"Build.FINGERPRINT: " + Build.FINGERPRINT;
}
示例9: getBrandName
public static String getBrandName() {
String brand = Build.BRAND;
log(TAG, "get brandName:" + brand);
if (brand == null || brand.length() <= 0) {
return "";
}
return brand;
}
示例10: getBrandName
public static String getBrandName() {
String brand = Build.BRAND;
if (brand == null || brand.length() <= 0) {
return "";
}
return brand;
}
示例11: leakInfo
public static String leakInfo(Context context, HeapDump heapDump, AnalysisResult result,
boolean detailed) {
PackageManager packageManager = context.getPackageManager();
String packageName = context.getPackageName();
try {
PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
String info = "In " + packageName + ":" + packageInfo.versionName + ":" + packageInfo
.versionCode + ".\n";
String detailedString = "";
if (result.leakFound) {
if (result.excludedLeak) {
info = info + "* LEAK CAN BE IGNORED.\n";
}
info = info + "* " + result.className;
if (!heapDump.referenceName.equals("")) {
info = info + " (" + heapDump.referenceName + SocializeConstants.OP_CLOSE_PAREN;
}
info = info + " has leaked:\n" + result.leakTrace.toString() + "\n";
if (detailed) {
detailedString = "\n* Details:\n" + result.leakTrace.toDetailedString();
}
} else {
info = result.failure != null ? info + "* FAILURE:\n" + Log.getStackTraceString
(result.failure) + "\n" : info + "* NO LEAK FOUND.\n\n";
}
return info + "* Reference Key: " + heapDump.referenceKey + "\n" + "* Device: " +
Build.MANUFACTURER + " " + Build.BRAND + " " + Build.MODEL + " " + Build
.PRODUCT + "\n" + "* Android Version: " + VERSION.RELEASE + " API: " +
VERSION.SDK_INT + " LeakCanary: " + BuildConfig.LIBRARY_VERSION + "\n" + "* " +
"Durations: watch=" + heapDump.watchDurationMs + "ms, gc=" + heapDump
.gcDurationMs + "ms, heap dump=" + heapDump.heapDumpDurationMs + "ms, " +
"analysis=" + result.analysisDurationMs + "ms" + "\n" + detailedString;
} catch (NameNotFoundException e) {
throw new RuntimeException(e);
}
}
示例12: getBrand
public static String getBrand() {
return Build.BRAND;
}
示例13: makeUA
public static String makeUA() {
final String ua = Build.BRAND + "/" + Build.MODEL + "/" + Build.VERSION.RELEASE;
return ua;
}
示例14: getBrand
@CalledByNative
public static String getBrand() {
return Build.BRAND;
}
示例15: h
public static String h() {
return Build.BRAND;
}