List of usage examples for android.os Build TYPE
String TYPE
To view the source code for android.os Build TYPE.
Click Source Link
From source file:de.schildbach.wallet.ui.ReportIssueDialogFragment.java
private static void appendDeviceInfo(final Appendable report, final Context context) throws IOException { final Resources res = context.getResources(); final android.content.res.Configuration config = res.getConfiguration(); final ActivityManager activityManager = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); final DevicePolicyManager devicePolicyManager = (DevicePolicyManager) context .getSystemService(Context.DEVICE_POLICY_SERVICE); report.append("Device Model: " + Build.MODEL + "\n"); report.append("Android Version: " + Build.VERSION.RELEASE + "\n"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) report.append("Android security patch level: ").append(Build.VERSION.SECURITY_PATCH).append("\n"); report.append("ABIs: ") .append(Joiner.on(", ").skipNulls() .join(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? supportedAbisLollipop() : supportedAbisKitKat())) .append("\n"); report.append("Board: " + Build.BOARD + "\n"); report.append("Brand: " + Build.BRAND + "\n"); report.append("Device: " + Build.DEVICE + "\n"); report.append("Display: " + Build.DISPLAY + "\n"); report.append("Finger Print: " + Build.FINGERPRINT + "\n"); report.append("Host: " + Build.HOST + "\n"); report.append("ID: " + Build.ID + "\n"); report.append("Product: " + Build.PRODUCT + "\n"); report.append("Tags: " + Build.TAGS + "\n"); report.append("Time: " + Build.TIME + "\n"); report.append("Type: " + Build.TYPE + "\n"); report.append("User: " + Build.USER + "\n"); report.append("Configuration: " + config + "\n"); report.append("Screen Layout: size " + (config.screenLayout & android.content.res.Configuration.SCREENLAYOUT_SIZE_MASK) + " long " + (config.screenLayout & android.content.res.Configuration.SCREENLAYOUT_LONG_MASK) + "\n"); report.append("Display Metrics: " + res.getDisplayMetrics() + "\n"); report.append(//from ww w . j a va2s . c o m "Memory Class: " + activityManager.getMemoryClass() + "/" + activityManager.getLargeMemoryClass() + (activityManager.isLowRamDevice() ? " (low RAM device)" : "") + "\n"); report.append("Storage Encryption Status: " + devicePolicyManager.getStorageEncryptionStatus() + "\n"); report.append("Bluetooth MAC: " + bluetoothMac() + "\n"); report.append("Runtime: ").append(System.getProperty("java.vm.name")).append(" ") .append(System.getProperty("java.vm.version")).append("\n"); }
From source file:com.stfalcon.contentmanager.ContentManager.java
/** * Check device model and return is need to set predefined camera uri *///w ww . j a v a 2s .com private boolean isSetPreDefinedCameraUri() { boolean setPreDefinedCameraUri = false; // NOTE: Do NOT SET: intent.putExtra(MediaStore.EXTRA_OUTPUT, cameraPicUri) // on Samsung Galaxy S2/S3/.. for the following reasons: // 1.) it will break the correct picture orientation // 2.) the photo will be stored in two locations (the given path and, additionally, in the MediaStore) String manufacturer = Build.MANUFACTURER.toLowerCase(Locale.ENGLISH); String model = Build.MODEL.toLowerCase(Locale.ENGLISH); String buildType = Build.TYPE.toLowerCase(Locale.ENGLISH); String buildDevice = Build.DEVICE.toLowerCase(Locale.ENGLISH); String buildId = Build.ID.toLowerCase(Locale.ENGLISH); // String sdkVersion = android.os.Build.VERSION.RELEASE.toLowerCase(Locale.ENGLISH); if (!(manufacturer.contains("samsung")) && !(manufacturer.contains("sony"))) { setPreDefinedCameraUri = true; } if (manufacturer.contains("samsung") && model.contains("galaxy nexus")) { //TESTED setPreDefinedCameraUri = true; } if (manufacturer.contains("samsung") && model.contains("gt-n7000") && buildId.contains("imm76l")) { //TESTED setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("ariesve")) { //TESTED setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("crespo")) { //TESTED setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("gt-i9100")) { //TESTED setPreDefinedCameraUri = true; } /////////////////////////////////////////////////////////////////////////// // TEST if (manufacturer.contains("samsung") && model.contains("sgh-t999l")) { //T-Mobile LTE enabled Samsung S3 setPreDefinedCameraUri = true; } if (buildDevice.contains("cooper")) { setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("t0lte")) { setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("kot49h")) { setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("t03g")) { setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("gt-i9300")) { setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("gt-i9195")) { setPreDefinedCameraUri = true; } if (buildType.contains("userdebug") && buildDevice.contains("xperia u")) { setPreDefinedCameraUri = true; } /////////////////////////////////////////////////////////////////////////// return setPreDefinedCameraUri; }
From source file:com.lewa.crazychapter11.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { //set to full screen // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); ///set to no title // requestWindowFeature(Window.FEATURE_NO_TITLE); // acionBar = getSupportActionBar(); // acionBar = getActionBar(); // acionBar.hide(); // Window win = getWindow(); // win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); // win.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); // win.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); // win.setStatusBarColor(Color.TRANSPARENT); // win.setNavigationBarColor(Color.TRANSPARENT); /*//*from w ww . ja va 2s. c o m*/ win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); win.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); win.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); win.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); win.setStatusBarColor(Color.TRANSPARENT); win.setNavigationBarColor(Color.TRANSPARENT); //*/ super.onCreate(savedInstanceState); setContentView(R.layout.main); /* setTheme(R.style.CrazyTheme); */ AddGameBtn(); AddNoification(); LookupContact(); AddServiceBtn(); broadcastMain(); mediaPlayerMain(); mediaRecordSoundMain(); cameraMain(); recordvideoMain(); queMySql(); TestFragment(); justForTest(); LoadJson(); AddTestBtn(); AddUsageStatsBtn(); AddPeopleProvideBtn(); getInput(); ////just for test shutdown broadcast receiver IntentFilter mIntentFilter = new IntentFilter("android.intent.action.ACTION_SHUTDOWN"); mIntentFilter.addAction("com.lewa.alarm.test"); mIntentFilter.addAction("android.provider.Telephony.SECRET_CODE"); mIntentFilter.addAction("android.intent.action.SCREEN_ON"); mIntentFilter.addAction("android.intent.action.SCREEN_OFF"); mShoutdown = new shutdownReceiver(); registerReceiver(mShoutdown, mIntentFilter); ////test preferences = getSharedPreferences("crazyit", MODE_WORLD_WRITEABLE | MODE_WORLD_READABLE); editor = preferences.edit(); preferencestime = getSharedPreferences("RMS_Shutdown_time", MODE_WORLD_WRITEABLE | MODE_WORLD_READABLE); editortime = preferencestime.edit(); SharedShutdownTimeRead(); AddSharedPreBtn(); etNum = (EditText) findViewById(R.id.etNum); // // int maxLength = 4; InputFilter[] fArray = new InputFilter[1]; fArray[0] = new InputFilter.LengthFilter(maxLength); etNum.setFilters(fArray); // // calThread = new CalThread(); calThread.start(); Log.i("algerheMain", "MainActivity onCreate in!!"); String page = getString(R.string.str_page, "345", "24"); Log.i("algerheMain", "page=" + page); // /just for test here ComponentName comp = getIntent().getComponent(); show_txt = (EditText) findViewById(R.id.show_txt); show_txt.setText( "??" + comp.getPackageName() + " \n ??" + comp.getClassName()); ////MD5 check item ///1.IMEI TelephonyManager TelephonyMgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); String szImei = TelephonyMgr.getDeviceId(); String m_szSIMSerialNm = TelephonyMgr.getSimSerialNumber(); CellLocation m_location = TelephonyMgr.getCellLocation(); String m_Line1Number = TelephonyMgr.getLine1Number(); String m_OperatorName = TelephonyMgr.getSimOperatorName(); Log.i("algerheTelephonyMgr", "szImei=" + szImei); Log.i("algerheTelephonyMgr", "m_szSIMSerialNm=" + m_szSIMSerialNm); Log.i("algerheTelephonyMgr", "m_location=" + m_location); Log.i("algerheTelephonyMgr", "m_Line1Number=" + m_Line1Number); Log.i("algerheTelephonyMgr", "m_OperatorName=" + m_OperatorName); Log.i("algerheMain01", "szImei=" + szImei); Log.i("algerheMain01", "m_szSIMSerialNm=" + m_szSIMSerialNm); ///2.Pseudo-Unique ID String m_szDevIDShort = "35" + //we make this look like a valid IMEI Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10 + Build.USER.length() % 10; //13 digits Log.i("algerheMain01", "m_szDevIDShort=" + m_szDevIDShort); ///3. Android ID String m_szAndroidID = Secure.getString(getContentResolver(), Secure.ANDROID_ID); Log.i("algerheMain01", "m_szAndroidID=" + m_szAndroidID); ///4.WLAN MAC Address string WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE); String m_szWLANMAC = "unknow_wifi_mac"; if (wm != null && wm.getConnectionInfo() != null) { m_szWLANMAC = wm.getConnectionInfo().getMacAddress(); } Log.i("algerheMain01", "m_szWLANMAC=" + m_szWLANMAC); ///5.BT MAC Address string BluetoothAdapter m_BluetoothAdapter = null; // Local Bluetooth adapter m_BluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); String m_szBTMAC = m_BluetoothAdapter.getAddress(); Log.i("algerheMain01", "m_szBTMAC=" + m_szBTMAC); ///6.sim serial number .getSimSerialNumber() // / ///reflect test checkMethod(); // */ final Intent alarmIntent = new Intent(); Log.i("algerheMain00", "isLewaRom=" + isLewaRom(this, alarmIntent)); handler = new Handler() { @Override public void handleMessage(Message msg) { if (msg.what == 0x4567) { String languageStr = null; String countryStr = null; Locale[] locList = Locale.getAvailableLocales(); for (int i = 0; i < locList.length; i++) { languageStr += locList[i].getLanguage(); countryStr += locList[i].getCountry(); } // show_txt = (EditText) findViewById(R.id.show_txt); show_txt.setText("" + languageStr + " \n " + countryStr); } else if (msg.what == 0x2789) { Log.i("algerheAlarm", "send alarm message in time=" + System.currentTimeMillis() + "\n action=" + alarmIntent.getAction()); // sendBroadcast(alarmIntent); } } }; // String strApkPath = intent.getStringExtra("apkPath"); // String strCmd = "pm install -r " + strApkPath; // try { // Process install = Runtime.getRuntime().exec(strCmd); // Log.d(TAG, "install = " + install + ", strCmd =" + strCmd); // }catch (Exception ex){ // Log.d(TAG, ex.getMessage()); // } // */ }
From source file:com.aware.Aware.java
private void get_device_info() { Cursor awareContextDevice = awareContext.getContentResolver().query(Aware_Device.CONTENT_URI, null, null, null, null);/* ww w.j a v a2s. c om*/ if (awareContextDevice == null || !awareContextDevice.moveToFirst()) { ContentValues rowData = new ContentValues(); rowData.put("timestamp", System.currentTimeMillis()); rowData.put("device_id", Aware.getSetting(awareContext, Aware_Preferences.DEVICE_ID)); rowData.put("board", Build.BOARD); rowData.put("brand", Build.BRAND); rowData.put("device", Build.DEVICE); rowData.put("build_id", Build.DISPLAY); rowData.put("hardware", Build.HARDWARE); rowData.put("manufacturer", Build.MANUFACTURER); rowData.put("model", Build.MODEL); rowData.put("product", Build.PRODUCT); rowData.put("serial", Build.SERIAL); rowData.put("release", Build.VERSION.RELEASE); rowData.put("release_type", Build.TYPE); rowData.put("sdk", Build.VERSION.SDK_INT); try { awareContext.getContentResolver().insert(Aware_Device.CONTENT_URI, rowData); Intent deviceData = new Intent(ACTION_AWARE_DEVICE_INFORMATION); sendBroadcast(deviceData); if (Aware.DEBUG) Log.d(TAG, "Device information:" + rowData.toString()); } catch (SQLiteException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } catch (SQLException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } } if (awareContextDevice != null && !awareContextDevice.isClosed()) awareContextDevice.close(); }
From source file:com.google.android.gms.common.zze.java
public static boolean zzoN() { return zzafL ? zzafM : "user".equals(Build.TYPE); }
From source file:com.google.android.gms.common.GooglePlayServicesUtilLight.java
public static boolean zzpd() { return zzapV ? zzapW : "user".equals(Build.TYPE); }
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;/*from w ww . j av a2 s. c o m*/ }
From source file:com.google.android.gms.common.GooglePlayServicesUtil.java
public static boolean dX() { return Ar ? As : "user".equals(Build.TYPE); }
From source file:es.javocsoft.android.lib.toolbox.ToolBox.java
/** * Generates a unique device id using the device * "serial" property if is available. If not, a bunch * of device properties will be used to get a reliable * unique string key for the device.//from ww w . j a v a 2 s. c om * * If there is an error in UUID generation null is * returned. * * @return The unique UUID or nul in case of error. */ private static UUID generateUniqueDeviceUUIDId() { UUID uuid = null; try { //We generate a unique id String serial = null; if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) { serial = Build.SERIAL; uuid = UUID.nameUUIDFromBytes(serial.getBytes("utf8")); } else { //This bunch of data should be enough to "ensure" the //uniqueness. String m_szDevIDAlterbative = "35" + //To look like a valid IMEI Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10 + Build.USER.length() % 10; //13 digits uuid = UUID.nameUUIDFromBytes(m_szDevIDAlterbative.getBytes("utf8")); } } catch (UnsupportedEncodingException e) { Log.e(TAG, "UnsupportedEncodingException (" + e.getMessage() + ").", e); } return uuid; }